Fórmulas e Cenas

Object Reference Not Set to Instance of an Object

  Home  |   Contact  |   Syndication    |   Login
  39 Posts | 0 Stories | 6 Comments | 0 Trackbacks

News

Archives

Post Categories

Links

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
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

update n set n.fieldToUpdate=o.fieldToUp... from originaltable o inner join toTable n on n.id= o.id...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

exec sp_changeobjectowner 'ObjectName', 'newOwner' More info at: http://msdn.microsoft.com/e
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

DBCC CHECKIDENT (yourtable, reseed, 0) Enjoy :)...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati