The following T-SQL shows how to reset a tables identity auto increment back the last available number. This may be useful if you have removed a bulk amount of data…
The following T-SQL shows how to reset a tables identity auto increment back to 1. This may be useful if you have cleared all data from a table and want…
The following T-SQL statement shows how output the name of a day from a date. For example, 16 March 2019 would output Saturday. SELECT DateName( weekday , GETDATE() ) as…
The following T-SQL statement shows how output the day from a date. For example, 16 March 2019 would output 16. SELECT DateName( day, GETDATE() ) as Day_From_Date
The following T-SQL statement shows how output the name of the month from a date. For example, 16 March 2019 would output March. SELECT DateName( month , GETDATE() ) as…
The following T-SQL statement shows how output a number as an ordinal number (st, nd, rd, th). For example, 3 would output 3rd. How do I use this? Replace '3'…
The following T-SQL statement shows how output the day from a date as an ordinal number (st, nd, rd, th). For example, 16 March 2019 would output 16th. How do…
The following SQL statement shows how to copy the data from one column to another. It will replace any existing values in the destination column - so be sure to…
The following T-SQL for Microsoft SQL Server shows how to convert line separated text to comma separated text. For example, if we had a table with the following data Lucky_Numbers 2 33…