Geeks With Blogs
Fórmulas e Cenas Object Reference Not Set to an Instance of an Object Database
How to list all Tables in MySql
select * FROM information_schema.tables where table_schema='YourSchema' ......

Posted On Monday, October 14, 2013 11:20 AM

Entity Framework, Insert Fail
When you are inserting into a table using entity framework, on rare occasions you might get the following error: {System.Data.OptimisticConc... Store update, insert, or delete statement affected an unexpected number of rows (0) This happened to me because of an "instead of INSERT" trigger that was active on the page. It turns out that EF does not go well with triggers, because it fails to get the inserted ID. For me, the solution was to change the trigger so that the last executed code ......

Posted On Tuesday, January 22, 2013 10:35 AM

How to restore a database using multiple transation log files (sql server 2000)
Restoring a database can be a pain in the ass, specially when you need to find some point in time where the data went wrong.This is the best way i know how:RESTORE DATABASE MY_TARGET_DATABASE FROM DISK = 'path_to_backup.bak' WITH NORECOVERY, replaceGORESTORE LOG MY_TARGET_DATABASE FROM DISK = 'mytransaction_log1.trn' WITH NORECOVERYGORESTORE LOG MY_TARGET_DATABASE FROM DISK = 'mytransaction_log2.trn' WITH NORECOVERYgoRESTORE LOG MY_TARGET_DATABASE FROM DISK = 'mytransaction_log3.trn' WITH NORECOVERYgoRESTORE ......

Posted On Monday, October 22, 2012 11:18 AM

How to find locks in sql server 2000
/* Processes that are blocking others */
select * from 
where spid in
	syslocks l
	inner join sysprocesses p on p.spid=l.spid
	p.dbid=5 -- Database ID
	and p.blocked<>0

/* Processes being blocked*/
	syslocks l
	inner join sysprocesses p on p.spid=l.spid
	and p.blocked<>0


Posted On Thursday, June 16, 2011 11:03 AM

Linq error: MSDTC on server 'servername' is unavailable
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: ......

Posted On Wednesday, August 11, 2010 6:39 AM

How to: Update a table from a select
update n set n.fieldToUpdate=o.fieldToUp... from originaltable o inner join toTable n on ......

Posted On Friday, July 9, 2010 8:00 AM

How to: Change the ownership of an object (MS SQL Server)

 exec sp_changeobjectowner 'ObjectName', 'newOwner'


More info at:

Posted On Wednesday, April 28, 2010 8:44 AM

How to: Reset table index on SQL Server
DBCC CHECKIDENT (yourtable, reseed, 0) Enjoy :) ......

Posted On Tuesday, March 2, 2010 10:34 AM

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 ......

Posted On Wednesday, February 17, 2010 9:15 AM

Copyright © Sglima | Powered by: