Category: TSQL

PostSharp AssemblyLoadException - Piotr Łuksza 0

Sql Server Reset Table Identity Value

If you want to reset identity value , just execute this command declare @tableName varchar(100) = ‘tableName’; declare @value int = 0; DBCC CHECKIDENT (tableName , reseed, @value) The next value will be 1, but you can choose any natural...

PostSharp AssemblyLoadException - Piotr Łuksza 0

Drop Linked Server IN Sql Server

Sometimes we get an error while adding linked server: “The server ‘LinkServerName’ already exists” The solution is to drop remote server name (with all associated remote logins) using a statement EXEC sp_dropserver ‘LinkServerName’, ‘droplogins’ After this, we shouldn’t see server...

tsql 0

TSQL Merge statement

SQl Server 2008 offers us an interesting feature called MERGE function that allows you to perform multiple actions in one query. I noticed, however, that many of my fellow programmers never did not use it. That is why I decided to...