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
Gouache painting of a small tent beside a large open-sided vermilion canopy over a picnic table

Create a Global Temporary Table in SQL Server

October 21, 2017
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL TempDB, Temp Table

A global temporary table starts with two # signs, lives in tempdb, and any session can read it. This post creates one, reads it from a second window, and shows when SQL Server drops it. It also covers name collisions and the cases where a different table type is the better choice.

Read More
Gouache painting of a path of stepping stones with one worn stone and a vermilion hourglass beside it

Stored Procedure Execution Count and Average Elapsed Time

October 19, 2017
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Scripts, SQL Server, SQL Stored Procedure

To find a stored procedure execution count, query sys.dm_exec_procedure_stats and divide the total elapsed time by the count. This post builds a demo, shows the query, and explains why the numbers start again when a plan leaves the cache. It also fixes the object name lookup that returns NULL for other databases.

Read More
Two temporary tile workspaces have different physical boundaries and one tile in each.

SQL SERVER – How to Create Table Variable and Temporary Table?

October 18, 2017
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL TempDB, Temp Table

A Temporary table uses CREATE TABLE, while a table variable uses DECLARE. I use one row in each beginner example.

Read More
Gouache painting of a brass scale with two dates on one pan and a tall heap of pears with a vermilion pomegranate on the other

Adding Two Dates in SQL Server: Why the Year Is 2126

October 17, 2017
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Operator, SQL Scripts, SQL Server

Adding two dates in SQL Server does not raise an error. It returns a date in the year 2126. This puzzle explains how datetime counts days from 1900, why the plus sign accepts a second date, and what to write instead.

Read More
Gouache painting of a line of watering cans by a greenhouse door, the first one vermilion

Run a Stored Procedure at Startup in SQL Server

October 16, 2017
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Stored Procedure, Starting SQL

To run a stored procedure at startup, create it in the master database and mark it with sp_procoption. This post builds a demo that writes one row every time the instance starts. It also covers the rules, how to check the setting, and how to turn it off again.

Read More
A closed workshop cabinet sits beside a loose hinge pin and wooden mallet

Can You DROP Offline Database? – Interview Question of the Week #144

October 15, 2017
Pinal Dave
SQL Interview Questions and Answers
SQL Scripts, SQL Server

Can you drop offline database in SQL Server? Yes, you can. Many DBAs I interviewed thought otherwise, so here is the full answer.

Read More
SQL SERVER - Empty Startup Parameters in SQL Server Configuration Manager

SQL SERVER – Empty Startup Parameters in SQL Server Configuration Manager

October 14, 2017
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server, Starting SQL

Configuration Manager showed Empty Startup Parameters when I tried to change the ERRORLOG location in my lab. Here is where they are stored and how to fix it.

Read More
Previous 1 … 151 152 153 154 155 156 157 … 420 Next
  • Books
  • Testimonials
  • Privacy Policy

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