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
A heavy book chained to a wooden library lectern, a reader's hands resting on its closed cover.

Letting an LLM Query SQL Server Safely: A Read-Only Login and Guardrails

January 1, 2024
Pinal Dave
AI
AI, SQL Login, SQL Server, SQL Server Security, SQL View

Let an LLM query SQL Server through a restricted login, approved views, enforced row filtering, execution limits, and query auditing.

Read More
A gatehouse window with the shutter half down and a red lamp inside

SQL SERVER – Login Experience with DEFAULT_DATABASE and MUST_CHANGE

October 18, 2023
Pinal Dave
SQL Tips and Tricks
SQL Login, SQL Server Security

DEFAULT_DATABASE and MUST_CHANGE shape the login experience. Tested on SQL Server 2025: the syntax that fails, and how the two lock a user out.

Read More
Gouache painting of a small wooden dollhouse with a closed door and a ring of keys hanging from a vermilion hook

ALTER AUTHORIZATION on a Database: Find and Change the Owner

May 3, 2022
Pinal Dave
SQL Tips and Tricks
SQL Login, SQL Scripts, SQL Server Security

ALTER AUTHORIZATION on a database changes its owner, and SUSER_SNAME(owner_sid) finds the current one. This post shows why a login that owns a database cannot be dropped and how to catch an orphaned owner.

Read More
Gouache painting of a courtyard wall with three open blue-grey doors, each with a small vermilion key in its lock

Login Database Access: List the Databases a Login Can Open

November 26, 2021
Pinal Dave
SQL Tips and Tricks
SQL Login, SQL Scripts, SQL Server Security

Check login database access by matching the login SID against the users of every online database. One query shows the user, the CONNECT state and the guest back door, and it needs no impersonation.

Read More
errorfix

SQL SERVER – Fix Error – Cannot execute as the database principal because the principal “dbo” does not exist

October 21, 2021
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Login, SQL Scripts, SQL Server, SQL Server Security

One of my clients recently sent me an email with the following error. The error was visible in the error log and was about the database principal. 

Read More
Gouache painting of a closed garden gate with a brass padlock and a doormat with a small vermilion mark

Unlock SQL Login Without Changing the Password

June 9, 2021
Pinal Dave
SQL Tips and Tricks
SQL Login, SQL Password, SQL Scripts, SQL Server Security

Unlock SQL login accounts without a new password: switch CHECK_POLICY off and on. See the lockout, the fix, and what to do when MUST_CHANGE blocks it.

Read More
A crowd of seagulls mobbing the hatch of a small beach kiosk while a hand pulls the shutter halfway down.

Logon Storms: Protecting SQL Server From Connection Floods

April 28, 2021
Pinal Dave
SQL Tips and Tricks
DBA, SQL Connection, SQL Login, SQL Server Security, SQL Trigger

Diagnose SQL Server logon storms, control connection growth, test a limited logon trigger, and preserve administrator recovery access.

Read More
1 2 3 4 … 14 Next
  • Books
  • Testimonials
  • Privacy Policy

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