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 - Find Table in Every Database of SQL Server

SQL SERVER – Find Table in Every Database of SQL Server

April 29, 2008
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL System Table

sys.tables only searches one database. My quick stored procedure finds a table in every database on the server and returns database, schema and table name.

Read More
Gouache painting: a long tan leather strap lies straight across a workbench with two brass studs a short gap apart near its middle

CHARINDEX Start Position: Find the Second Delimiter

April 27, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

CHARINDEX start position finds the next delimiter. Guard a missing first match, preserve NULL, and extract empty fields without negative lengths.

Read More
A hand lifting the cap of a brass speaking tube that runs to a far room

Using Synonyms to Simplify Cross-Database Queries

April 25, 2008
Pinal Dave
SQL Tips and Tricks
Schema, SQL Migration, SQL Server, SQL Server Security

Using synonyms can hide a cross-database object name from callers, but permissions, dependency checks, and deployment still need care.

Read More
A garden trellis with vines tied on with twine, and one vine leaning against it without any tie

Drawing a Diagram of an Existing Database

April 24, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Documentation, SQL Server, SQL Server Management Studio

A diagram of an existing database starts with real foreign keys, uses SSMS to reveal relationships, and records the important paths a picture misses.

Read More
Gouache painting: seen from above, three furrows lie side by side: one long, one shorter, one long

EOMONTH: Month Ends Are Different From DATEADD Month Clipping

April 21, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

EOMONTH gives me a month-end date when that is the actual reporting requirement. DATEADD moves a date by a month. These operations can agree for one step and disagree on the next.

Read More
SQL SERVER - Identifiers As Valid Object Names

SQL SERVER – Identifiers As Valid Object Names

April 20, 2008
Pinal Dave
SQL Tips and Tricks
SQL System Table

Chi-Ho Min found you can skip parts of a four part name with dots, like servername…tablename. Here is how identifiers work as valid object names.

Read More
SQL SERVER - Generate Foreign Key Scripts For Database

SQL SERVER – Generate Foreign Key Scripts For Database

April 18, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

Madhaiyan Seenivasan’s stored procedure lets you generate foreign key scripts for a whole database, handy when you drop all foreign keys and add them back.

Read More
Previous 1 … 509 510 511 512 513 514 515 … 570 Next
  • Books
  • Testimonials
  • Privacy Policy

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