Database
/* Processes that are blocking others */ select * from sysprocesses where spid in ( select blocked from syslocks l inner join sysprocesses p on p.spid=l.spid where p.dbid=5 -- Database ID and p.blocked<>0 ) /* Processes being blocked*/ select p.* from syslocks l inner join sysprocesses p on p.spid=l.spid where p.dbid=5 and p.blocked<>0
Occasionally an application that I am working on throws the above error... After trying to fix my code for a bit, and not finding the problem I googled a bit and discovered that this error is caused by a windows service that must be running. So, if you ever encounter this error, you must turn on the 'Distributed Transaction Coordinator' in order to solve it. Hope this helps. Original source: http://geekswithblogs.net/n...
update n set n.fieldToUpdate=o.fieldToUp... from originaltable o inner join toTable n on n.id= o.id...
exec sp_changeobjectowner 'ObjectName', 'newOwner' More info at: http://msdn.microsoft.com/e
DBCC CHECKIDENT (yourtable, reseed, 0) Enjoy :)...
I think it's common knowledge that timeouts can be set on connection strings to ensure that a certain connection doesnt say open for more than SSS seconds. What is not so common knowledge is the fact that on a transaction every single command has its own timeout value and if exceded it can bring down the entire transaction. So when using transactions take in mind that you can set the connection timeout to 20 minutes, but if a single command that takes a few extra seconds can timeout. To prevent this...