Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Wednesday, June 18, 2008

Finding and listing columns with default values in a database

This one is a handy script I found on a blog.


SELECT SO.NAME AS "Table Name", SC.NAME AS "Column Name", SM.TEXT AS "Default Value"
FROM dbo.sysobjects SO INNER JOIN dbo.syscolumns SC ON SO.id = SC.id
INNER JOIN dbo.syscomments SM ON SC.cdefault = SM.id
WHERE SO.xtype = 'U'
ORDER BY SO.[name], SC.colid



Read more at mssqltips.com

Tuesday, June 17, 2008

Deleting duplicate records.

Its a nice post on deleting duplicate records. She has mentioned 3 different methods with their advantages and disadvantages.

SQLteam.com

Object Oriented approach for SQL

Implementing Table inheritance in SQL Server.
SQlTeam.com

Implementing Table Interfaces
SQLTeam.com

The Golden Rule of Data Manipulation

This is a very good post about data design.
SQLTeam Golden Rule Of Data manipulation

It is suggested that Concatenating is easier than parsing scripts. Thus wherever possible one must segregate the data. e.g Full name phone numbers etc.