question

shamim007 avatar image
shamim007 asked

TSQL QUERY

Hi Experts ,My developer write below TSQL query and asked me to review it . what steps should i take ?and how i do i test it ? BEGIN INSERT INTO nsConfig (MachineName, PropertyName, PropertyValue) VALUES ('*', 'PurgeDocumentsBatchSize', '1000'); END IF NOT EXISTS( SELECT * FROM sys.schemas s INNER JOIN sys.tables t ON s.schema_id = t.schema_id INNER JOIN sys.columns c ON t.object_id = c.object_id WHERE s.name = 'dbo' AND t.name = 'nsTransactionProperties' AND c.name = 'ToBePurgedDate' ) BEGIN ALTER TABLE nsTransactionProperties ADD ToBePurgedDate DATETIME NULL; END IF NOT EXISTS( SELECT * FROM sys.schemas s INNER JOIN sys.tables t ON s.schema_id = t.schema_id INNER JOIN sys.columns c ON t.object_id = c.object_id WHERE s.name = 'dbo' AND t.name = 'nsPDFDocument' AND c.name = 'PurgedDocumentHash' ) BEGIN ALTER TABLE nsPDFDocument ADD PurgedDocumentHash VARBINARY(MAX) NULL; END END thanks
sql-server-2008tsql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.