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
SQL SERVER - Size of Index Table for Each Index - Solution 2

SQL SERVER – Size of Index Table for Each Index – Solution 2

May 9, 2010
Pinal Dave
SQL Performance
SQL Data Storage, SQL Index, SQL Scripts

A second solution to my size of index table puzzle: Rama Mathanmohan’s query sums used pages from sys.allocation_units to give each index size in KB.

Read More
A long cord of wooden beads tied to a brass ring, every seventh bead red, a fingertip on the first

Finding the First Monday of Every Month in T-SQL

May 8, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Calculate the first Monday without DATEFIRST, list a full year, find nth and last weekdays, and reuse the rules in an inline table function.

Read More
SQL SERVER - Get Latest SQL Query for Sessions - DMV

SQL SERVER – Get Latest SQL Query for Sessions – DMV

May 5, 2010
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Scripts

Want the latest SQL query for sessions on your server? Join sys.dm_exec_connections with sys.dm_exec_sql_text using most_recent_sql_handle.

Read More
SQL SERVER - SHRINKFILE and TRUNCATE Log File in SQL Server 2008

SQL SERVER – SHRINKFILE and TRUNCATE Log File in SQL Server 2008

May 3, 2010
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Data Storage, SQL Scripts

A reader’s job failed after upgrading to SQL Server 2008 because TRUNCATE_ONLY is gone. My notes on SHRINKFILE and TRUNCATE Log File, and what to watch for.

Read More
SQL SERVER – Attach mdf file without ldf file in Database

SQL SERVER – Attach mdf file without ldf file in Database

April 26, 2010
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Data Storage, SQL Scripts

A friend sent me only his mdf file instead of a backup of the database. Here is how to attach mdf file without ldf file and let SQL Server build a new log.

Read More
SQL SERVER - T-SQL Script to Take Database Offline - Take Database Online

SQL SERVER – T-SQL Script to Take Database Offline – Take Database Online

April 24, 2010
Pinal Dave
SQL Tips and Tricks
SQL Scripts

A reader asked how to bring a database back online. This short T-SQL script will take database offline with ROLLBACK IMMEDIATE and then online again.

Read More
SQL SERVER - Update Statistics are Sampled By Default

SQL SERVER – Update Statistics are Sampled By Default

April 23, 2010
Pinal Dave
SQL Performance
SQL Index, SQL Scripts, SQL Statistics

A reader asked if statistics are sampled by default. They are, and a one million row test table proves it. You can set the rate up to 100%.

Read More
Previous 1 … 259 260 261 262 263 264 265 … 363 Next
  • Books
  • Testimonials
  • Privacy Policy

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