This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Pistachios fill six cavities of a wooden mold while two middle cavities remain empty.

Value Histograms: Counting Rows per Range Bucket in T-SQL

February 21, 2009
Pinal Dave
SQL Tips and Tricks
SQL Group By, SQL Scripts, Temp Table

Turn a column of amounts into a clear shape. Three small traps decide whether your bucket counts are true: empty buckets, uneven ranges and BETWEEN.

Read More
An overfull piggy bank with coins stuck in its slot, a larger empty red one beside it

Checking IDENTITY Columns Before They Run Out of Numbers

February 20, 2009
Pinal Dave
SQL Tips and Tricks
DBA, SQL Datatype, SQL Identity, SQL Scripts

Check IDENTITY columns for their current value, type limit and remaining range, including descending increments, before inserts fail.

Read More
A hand deals plain counters among three cups, each already holding one red counter.

Assigning Rows Round-Robin to Workers With ROW_NUMBER

February 19, 2009
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Scripts, Temp Table

Number the tasks, number the workers, match them with a remainder. A fair queue in one query, and the two shortcuts that quietly break it.

Read More
Movers measuring a narrow doorway before carrying a red sofa through

Reviewing a Table Change Script Before It Locks Production

February 18, 2009
Pinal Dave
SQL Tips and Tricks
DBA, SQL Lock, SQL Server, SQL Table Operation

Review a table change script for schema locks, data rewrites, supported online options, backfill batches, and a tested rollback.

Read More
SQLOutlook, SQL Server, database, file locations.

SQL SERVER – Find Current Location of Data and Log File of All the Database

February 17, 2009
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts, SQL Server Security, SQL System Table

A one line query on sys.master_files that shows the current data and log file location for all databases, handy when cleaning up old .mdf and .ldf files.

Read More
SQL SERVER - List All Server Wide Configurations Values

SQL SERVER – List All Server Wide Configurations Values

February 16, 2009
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Stored Procedure, SQL System Table

I forgot the syntax to check the two digit year cutoff, so I listed all Server Wide Configurations with sys.configurations. A small script worth saving.

Read More
SQL SERVER - Reasons to Backup Master Database - Why Should Master Database Backedup

SQL SERVER – Reasons to Backup Master Database – Why Should Master Database Backedup

February 15, 2009
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Backup and Restore, SQL Data Storage, SQL Server Security, SQL Utility

Why should you backup master database? It holds all logins, system configuration and the details SQL Server needs to reach every other database.

Read More
SQLCMD command window with a query.

SQL SERVER – Restore Master Database – An Easy Solution

February 14, 2009
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts, SQL Server Security, SQL Utility

A two step easy way to restore master database: start SQL Server in single user mode, then restore from a full backup of master. No full backup, no restore.

Read More
XML Query results.

SQL SERVER – Simple Example of Reading XML File Using T-SQL

February 13, 2009
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL XML

A simple example of reading XML file content using T-SQL: load the XML into a variable and pull out elements and attributes with value() in a SELECT.

Read More
SQL SERVER - Simple Example of Creating XML File Using T-SQL

SQL SERVER – Simple Example of Creating XML File Using T-SQL

February 12, 2009
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL XML

I always want to learn SQL Server and XML file. Let us go over a very simple example, today about how to create XML using SQL Server.

Read More
Previous 1 … 500 501 502 503 504 505 506 … 590 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com