Showing posts from May, 2010
In one to many relationships of two tables, sometimes we need to write a query which can return comma separated list of all child values for each parent. Here are two different methods by which yo…
I found many questions regarding the inline named default constraints in many user groups, its actually pretty simple CREATE TABLE dbo.tempabc ( [col1] [ varchar ] (16), [col2] [ int ] NULL CONS…
CREATE TABLE dbo.tempabc ( [col1] [ varchar ] (16), [col2] [ int ] NULL CONSTRAINT df__tempabc__Col2 DEFAULT ((0)) ) ON [ PRIMARY ] GO ALTER TABLE dbo.tempabc ALTER COLUMN Col1 VARCHAR (32)…
SELECT DB_NAME(mf.database_id) AS databaseName ,mf.physical_name ,num_of_reads ,num_of_bytes_read ,io_stall_read_ms ,num_of_writes ,num_of_bytes_written …