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 - 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 … 333 334 335 336
  • Books
  • Testimonials
  • Privacy Policy

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