SQL Server Scripts

Useful SQL Server Scripts

Thursday, 19 September 2013


Friday, 22 February 2013

SQL Server Script : Search content or text within SQL Stored Procedures in database using SQL Query

There are many situations where in past we did some useful functionality in some stored procedures after that as time goes we forgot that how exactly we had done that functionality and now we want implement that functionality  Read More...

Thursday, 13 December 2012

Get list of all stored procedures and it's useful details from sql server database

There are many situations where you want to list of stored procedures from your database and it's useful details like , SP created date , modify date etc.. using sql query. There is simple way to get these information using sql query. We are using "sys.procedures" system table to get list and details. Read More...

Friday, 7 December 2012

Get list of all tables and it's useful details in sql server database

There are many situations where you want to list of tables and it's useful details like , table created date , modify date etc.. using sql query. There is simple way to get these informations using sql query. We are using "sys.tables" system table to get list and details. Read More...

Friday, 16 November 2012

Get Parent Child hierarchy or tree structure or recursive records in sql query

You can get parent child hierarchy records or category sub category records or recursive records from table in sql server and display as a tree structure. We are using A common table expression (CTE) to get result. In fact we are using Recursive CTE to get this recursive data. Read More...

Thursday, 1 November 2012

SQL Server Scripts : Insert particular value in Identity column in table by using IDENTITY_INSERT property

You can insert value in identity column manually using INSERT statement using "IDENTITY_INSERT" property. You need to set IDENTITY_INSERT property to ON to allow identity insert value. Read More...

Wednesday, 12 September 2012

Get column names of tables using inbuilt SQL Server Stored Procedure

here is a situations where you want to know the column names and it's data type and other column relavant information of a particular table. Read More...

Friday, 31 August 2012

SQL Server Scripts : List all tables name that contain particular column name using SQL Query

There are many situations where you want to get all tables name that contains particular column name using sql query. Here is query for this. Read More...

Monday, 16 July 2012

Sql Server Scripts : Get database name of current connection

You can get current database name using In Built SQL function "DB_NAME()". Read More...

Monday, 18 June 2012

SQL Server Scripts : Get XML of Table's Data using SQL Query

You can seen that XML is now every where to exchange data between multiple system and platform. Here are sample query which retrive XML of particular Table's data. XML support is available on SQL Server 2000 with SQLXML 3.0 and its XML extensions, and There are in built native XML data type support in SQLServer 2005 and 2008. Read More...

Monday, 11 June 2012

SQL Server Scripts : Insert Unicode data in SQL Server

Are you having a problem of store Unicode data in database table and it will display "??????" ? Here are solution for that. SQL Server supports Unicode data in nchar, nvarchar and ntext datatypes. If you are inserting unicode data as regular data at that time sql does not store unicode characters it store "??????" (Question marks) in also display this "??????" Read More...

Friday, 18 May 2012

Get SQL Server Database Physical file Location and file size using sql script

Some time you Database Physical file Address and file size using sql script. Read More...

Friday, 13 April 2012

How to Reset the Identity Column of a table in Sql Server

Sometimes we have situation in which we want delete all records of table and that table containts identity column as primary key and we want again insert some new records in this table , so in this case identity column does not start with 1 but it start with last number that we had before deleted records. Read More...

Friday, 6 April 2012

Comma seperated values from table column - Multiple Solutions

In some cases we need to get comma separated or any user defined separator values from table column. There are multiple solutions for that. Read More...

Tuesday, 3 April 2012

Delete duplicate records from table

There are a situation in which you want to delete duplicate records from table. Here are example in which i created on temp table and add four columns, in this three columns are data columns and one column is ID column. Read More...

Wednesday, 28 March 2012

Difference Between Local and Global temporary table in SQL SERVER

Local temporary tables are visible only in to their creators during the same connection to an instance of SQL Server as when the tables were first created or referenced. Local temporary tables are deleted after disconnects from SQL Server instance . Read More...

Monday, 19 March 2012

Create a FILESTREAM-Enabled Database

If you want to use FILESTREAM data storage features in database you must create FILESTREAM enabled database. Read More...

Friday, 9 March 2012

Various functions to get system date and time in Sql Server 2008

Here are varios functions to get system date and time. Read More...

Friday, 24 February 2012

Get SQL server version details using SQL Commands

Following command get full SQL server version details: Read More...

1 comment: