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
An open ledger on a reading stand with a thin sheet of glass laid over the pages.

SQL SERVER – Making Database to Read Only – Changing Database to Read/Write

April 16, 2011
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts, SQL Server

A reader attached a client database and it showed as Read Only. Two simple ALTER DATABASE scripts switch a database to READ_ONLY and back to READ_WRITE.

Read More
SQL SERVER - Finding Location of Log File when Primary Datafile is Crashed

SQL SERVER – Finding Location of Log File when Primary Datafile is Crashed

April 15, 2011
Pinal Dave
SQL Puzzle
SQL Scripts

Do you need the primary datafile to back up the log after a crash? Vinod Kumar asked, so I tried finding the location of the log file without it.

Read More
Recent queries list.

SQL SERVER – Query to Recent Query on Server with Execution Plan Function to Get SQL

April 12, 2011
Pinal Dave
SQL Tips and Tricks
SQL Scripts

For T-SQL Tuesday on the APPLY clause, I share the script I use to see each recent query on server along with its execution plan from the cache.

Read More
Gouache painting: from a wooden beam hang two brass bells with a wide gap between them

hierarchyid GetDescendant: Insert Between Siblings

March 30, 2011
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

hierarchyid GetDescendant can generate a sibling location before, after or between existing bounds. This read-only example computes paths without inserting records or guaranteeing allocation.

Read More
Two wooden gate latches with a separate key below each latch.

Partition Stats Permissions: A SQL Server 2025 CU9 Counterpoint

March 25, 2011
Pinal Dave
SQL Tips and Tricks
SQL Monitoring, SQL Scripts, SQL Server, SQL Server Security

A controlled SQL Server 2025 CU9 test separates partition metadata visibility from access to table rows. Compare the documented permission pair with observed grant behavior, and keep the build-specific result within its measured scope.

Read More
A wooden bar latch above a separate metal valve handle and pipe flowing into a stone basin.

STARTUP_STATE: Check Whether an Extended Events Session Is Running

March 24, 2011
Pinal Dave
SQL Tips and Tricks
SQL Extended Events, SQL Monitoring, SQL Scripts, SQL Server

STARTUP_STATE controls automatic startup after SQL Server starts, while current session state tells whether an Extended Events session is running now. Compare both states and verify an event-file capture before assuming that a setting started the session.

Read More
Tempdb table negative objectid.

SQL SERVER – Denali – ObjectID in Negative – Local TempTable has Negative ObjectID

March 23, 2011
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL System Table

On Denali I saw many negative ObjectID values in sys.all_objects. Here is how I found out that each local temp table gets a negative ObjectID.

Read More
Previous 1 … 234 235 236 237 238 239 240 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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