SQL SERVER – 2005 – SSMS Change T-SQL Batch Separator

I recently received one big file with many T-SQL batches. It was very big file and I was asked that this file was tested many times and it can run one transaction. I noticed the separator of the batches is not GO but it was EndBatch. I have following two options to run the whole batch in one transation.

1) Mass replace EndBatch with GO.
Only problem I had with is that if EndBatch word was used in other place then batch separator it will replace there too. I searched and noticed that it was used in name of the Stored Procedure. I finally came up with second method which worked fine.

2) Change the batch separator.
Go to Tools >> Options >> Change the Batch Separator to EndBatch from GO.
SQLSERVER ChangeBatchSeparator SQL SERVER   2005   SSMS Change T SQL Batch Separator

Reference : Pinal Dave (http://blog.SQLAuthority.com)

Additional Read about GO operator: SQL SERVER – Explanation SQL Command GO

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s