SET clause in SQL Server (2008/2005)

SET clause in SQL Server uses in combination with other clauses to change the current behavior of the SQL Server in current sessions. Many of the default setting of the SQL Server that was setting up before, can be change with SET command, like date format, or first day of the week, or transaction explicit | implicit state etc.

I use very often SET DATEFORMAT dmy, according to my location date format, and there are some SET statement examples:

SET DATEFORMAT DMY –setting the date time format Day Month Year

SET DATEFIRST 1 — that means that the start day of the week is Monday.

SET IMPLICIT_TRANSACTION ON or OFF –setting implicit or explicit transaction state in current session.

SET IDENTITY_INSERT table_name ON or OFF –setting the Identity Insert in to the identity column of the table.


Check the full list of the SET command in combination with other statements, here

Stay Tuned!

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s