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 glass jar full of cream, slate blue and sage marbles on a wooden table, with a small wooden scoop and one loose marble in front

APPROX_COUNT_DISTINCT in SQL Server: Saves Memory, Not Time

May 29, 2009
Pinal Dave
SQL Performance
SQL Function, SQL Memory, SQL Performance, SQL Scripts

APPROX_COUNT_DISTINCT counts distinct values with almost no memory. Tested on 5 million rows, it was within 2.2 percent of the exact count and needed no memory grant, while COUNT(DISTINCT) asked for 436 MB. It was not faster.

Read More
SQL SERVER - Interesting Observation of Logon Trigger On All Servers

SQL SERVER – Interesting Observation of Logon Trigger On All Servers

May 27, 2009
Pinal Dave
SQL Tips and Tricks
SQL Audit, SQL Scripts, SQL Server, SQL Trigger

I created a Logon Trigger to audit every successful login for a client, and one login was recorded several times on different threads. The script and what I saw.

Read More
SQL SERVER - Find Hostname and Current Logged In User Name

SQL SERVER – Find Hostname and Current Logged In User Name

May 26, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL Server Security

Connected to many servers in SSMS? HOST_NAME() and SUSER_NAME() show the hostname and current logged in user for any query window.

Read More
SQL Server Management Studio - Object Explorer.

SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )

May 21, 2009
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server Management Studio

Named Pipes Provider error 40, could not open a connection to SQL Server, hit me after I rebuilt my home network. Here are the common errors and the fix.

Read More
A neatly arranged small set of plain hand tools resting in an open canvas tool roll on wood.

The Scripts Worth Having on Every Server You Touch

May 20, 2009
Pinal Dave
SQL Tips and Tricks
Best Practices, Database, SQL Scripts, SQL Server

Keep focused DBA scripts for active requests, blocking, table size, index usage, backups, and failed jobs, with clear limits on each result.

Read More
Saving changes dialog box.

SQL SERVER – Fix : Management Studio Error : Saving Changes in not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created

May 18, 2009
Pinal Dave
SQL Tips and Tricks
Database, SQL Error Messages, SQL Scripts, SQL Server Management Studio

SSMS says saving changes is not permitted when a table must be re-created. Learn to turn off Prevent saving changes, and why I still prefer T-SQL.

Read More
SQL SERVER - How to Drop Temp Table - Check Existence of Temp Table

SQL SERVER – How to Drop Temp Table – Check Existence of Temp Table

May 17, 2009
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL TempDB, Temp Table

Readers often ask how to check existence of a temp table and how to drop temp table without Msg 2714. My earlier article answers all of these questions.

Read More
Previous 1 … 284 285 286 287 288 289 290 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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