Sunday, May 11, 2014

Sql server

This example returns the session ID, login name, and user name for the current user process.
SELECT @@SPID AS 'ID', SYSTEM_USER AS 'Login Name', USER AS 'User Name';
Here is the result set.
ID Login Name User Name ------ ------------------------------ ------------------------------ 54 SEATTLE\joanna dbo



sp_who



select * from sys.sysprocesses

Get sql handle from above command for spid and pass parameter to below command

SELECT * FROM sys.dm_exec_sql_text(0x030005004E96637D86AB7300DBA2000001000000)


Truncate is faster than delete

http://www.softwaretestinggeek.com/2010/04/why-truncate-is-faster-than-delete.html?m=1

No comments:

Post a Comment