Thursday, March 24, 2011
The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported
Saturday, March 5, 2011
MSDTC on server 'servername' is unavailable
- Click on Ctrl+R then type services.msc in run command then click OK,Service Manager will display.
- Scroll through the list and identify the service “Distributed Transaction Coordinator”
- Right on the service and choose “Start”
Monday, January 24, 2011
How to Reset Identity column in SqlServer
In this post i explained how to reset the identity column in a table.
we have two methods to reset the identity column
1) Using Truncate Method.
2) Using DBCC (database consistency checker)
But TRUNCATE TABLE cannot be used when a foreign key references the table to be truncated where as DBCC can.
here is the Query using DBCC
DBCC CHECKIDENT('Table Name', RESEED, 0)
In Above query '0' is the reset idetity seed number,you can give any number whatever you want like 20,30 etc..
Here is the Query Using Truncate
truncate table TableName
Insert value from one Database Table to another Database Table
Access Remote sql server’s database table
Syntax for accessing Remote SqlServer:
select * from Servername.Databasename.dbo.Tablename
it will give following error
“Msg 7202, Level 11, State 2, Line 1
Could not find server 'ServerName' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
”
The syntax to add a remote sql server to sys.servers is:
If you add your remote server to sys.servers then you can access remote server using following simple query.
select * from servername.databasename.dbo.tablename