After migrating an Oracle database to SQL 2005, all the identity values were not properly set. This script goes through and sets them all to 1 greater than the max value in the identity column.
2007-09-21 (first published: 2007-05-24)
442 reads
This is how I pull record counts for every user table in a DB... some of my tables are very large and this works for table with our without index very fast.
2007-09-20 (first published: 2007-05-24)
2,950 reads
Everyone has a set of handy utilities and tools that they use with their SQL Server, but sometimes convincing an employer to purchase tools is hard. Longtime DBA David Bird brings us a list of the tools he likes to use and are FREE.
2008-04-10 (first published: 2007-05-24)
65,543 reads
This script will DELETE ALL constraints within the database that you define and in the following order: Foreign Key, Primary Key and then Unique Key.CAUTION:This script does not print out the ALTER TABLE statements, it drop the constraints immediately, therefore backup your database before testing or using this script. I ran the script below and […]
2007-09-19 (first published: 2007-05-23)
4,077 reads
What is the fastest way to update a newly created column in a large table? New author Bimal Fernando brings us a look at a technique he uses for just this situation.
2008-04-07 (first published: 2007-05-21)
7,738 reads
DESCRIPTION:This procedure will allow you to display results vertically (down) instead of across the screen. It's great when you are dealing with a query that has 50 columns and just a couple of records. LIMITATIONS: * It will be very slow if you are trying to return a lot of records. Works best for queries […]
2007-05-23 (first published: 2007-05-19)
2,905 reads
DESCRIPTION:This procedure produces a SELECT statement which explicitly lists all fields for 'tablename' with fieldname and alias as the column name. The SELECT it produces is ready to run or if you need to join several tables just copy the column names off the SELECT it generates. I use this a lot when I create […]
2007-05-22 (first published: 2007-05-19)
173 reads
I realize that RTrim(LTrim is not that hard to type, but, I feel this is cleaner
2007-09-13 (first published: 2007-05-16)
325 reads