Skip to main content

Scripts

SQL Script to list all the columns of a table with the Schema Information

SQL Script to list all the columns of a table with the Schema Information

If you are looking for a SQL Script which will display a list of all columns in a table and also the Schema Information, you can use the following Script.

DateTime Craziness in SQL Server when looking for records within a date range

Working with the DataTime datatype in SQL Server can be very frustrating at times Especially, when you use them in your where clause. For example If you want to list all records within a certain date range, you might end up retrieving incorrect rows.

How to find the duplicate rows in a table using sql script?

Posted in

Here is the SQL Script to find the duplicate rows in a table in SQL Server

Using CHARINDEX vs LIKE in Where Clause

Posted in

Is there any performance difference between using CHARINDEX vs LIKE in Where Clause?

 

Different ways of inserting more than one record into a table

Posted in

Method  1:   Using the Select INTO Statement

How to not display the column header in the output of a MS SQL Script?

Posted in

If you are using the SQLCMD utility and want to avoid or suppress the column header in the output of SQL Script.

How to Retrieve record with Null Values in MS SQL

Posted in

How to retrieve records from table which has null values.

Here is the Script which will list records which has null values for CountryID column. 

select * from yourTable where CountryID is null

 

Syndicate content