Archive for July, 2010

How to retrieve Inserted, Updated, and Deleted ROW IDENTITY for Trigger in SQL Server 2005

It is very simple to retrieve or select Row Identity or other Columns of inserted, updated or deleted Row while writing a Trigger.


CREATE  TRIGGER tr_EmployeeInsert
ON t_Employee
AFTER INSERT AS
BEGIN

DECLARE @InsertedID AS INT;
SELECT @InsertedID =  EmployeeID FROM INSERTED;
--Now you have the INSERTED Row ID

END

Continue reading

Case Sensitive String Comparison in SQL Server

SQL Server is installed with default “Collation” if it is not specified. You can check out your Database Server default “Collation” using this query.


SELECT SERVERPROPERTY ('Collation');

Continue reading

Delete Confirmation in ASP.NET GridView

While using GridView in ASP.NET, you will not be able to write OnClientClick code for asp:CommandField Link / Button directly. However, if you want to generate Confirmation for Delete Link / Button, Continue reading