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
Card file of index cards, going through records one at a time like a cursor

SQL SERVER – Simple Cursor to Select Tables in Database with Static Prefix and Date Created

November 30, 2006
Pinal Dave
SQL Tips and Tricks
SQL Cursor, SQL DateTime, SQL Scripts, SQL Server, SQL Stored Procedure

A simple cursor to select tables in a database by a static prefix like b_ or delete_ and by date created, so you can drop, print or index old tables.

Read More
SQL SERVER - Auto Generate Script to Delete Deprecated Fields in Current Database

SQL SERVER – Auto Generate Script to Delete Deprecated Fields in Current Database

November 20, 2006
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Stored Procedure

I mark old columns with a dep_ prefix, then auto generate the script to delete deprecated fields and drop their constraints first. Here is the query I use.

Read More
SQL SERVER - Query to Find ByteSize of All the Tables in Database

SQL SERVER – Query to Find ByteSize of All the Tables in Database

November 10, 2006
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Stored Procedure

A short query to find the ByteSize of All the Tables in a database. It sums column lengths per table from sysobjects and syscolumns, with a WITH CUBE total.

Read More
SQL SERVER - Query to Display Foreign Key Relationships and Name of the Constraint for Each Table in Database

SQL SERVER – Query to Display Foreign Key Relationships and Name of the Constraint for Each Table in Database

November 1, 2006
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Stored Procedure

A long query on INFORMATION_SCHEMA views that shows foreign key relationships for each table: the table, column, referenced table and the constraint name.

Read More
Previous 1 … 500 501 502 503
  • Books
  • Testimonials
  • Privacy Policy

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