lang="en-US"> MSSQL –, LLC

Tagged: MSSQL


MSSQL Tutorial: Delete All But 1 Duplicate Records

declare @id int, @total int /* SELECT COUNT OF POTENTIAL DUPLICATES */ select id, count(id) from [tablename] where [parameters] group by [column name] /* LOOP TO CLEAN UP THE DUPLICATES */ declare aff_crsr cursor...


SQL Tutorial: Select, Update & Delete Syntax

Select Statements General Syntax SELECT [column], [column], [column] FROM [tablename] WHERE [column] = [value] Select All Columns SELECT * FROM [tablename] Limit # of Records Returned – MSSQL SELECT TOP [number] * FROM [tablename]...


MSSQL Tutorial: Search code inside of stored proceedures

DECLARE @SEARCHSTRING VARCHAR(255), @notcontain Varchar(255) SELECT @SEARCHSTRING = ‘expiration_date =’, @notcontain = ” SELECT DISTINCT AS [Object Name] , case when sysobjects.xtype = ‘P’ then ‘Stored Proc’ when sysobjects.xtype = ‘TF’ then ‘Function’...