Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Tuesday, August 17, 2010

Find number of columns in a table in sql server 2000 and 2005 also

select count(*) NoOfColumns from SYSCOLUMNS
WHERE id= (Select id from SYSOBJECTS where name = 'emp')

What is live lock and deadlock? what is Lock escalation?

In SQL Server Live Lock occurs when read transactions are
applied on table which prevents write transaction to wait
indefinitely and Deadlocking occurs when two user processes
have locks on separate objects and each process is trying to
acquire a lock on the object that the other process has.

Lock escalation is the process of converting a lot of low
level locks (like row locks, page locks) into higher level
locks (like table locks).

What is OPENXML in SQL Server?

OPENXML can parse the xml data in SQL server very efficiently in SQL Server. OpenXML primarily gives the ability to insert XML data to the relational database, however we can query the data too using OpenXML. We need to specify the path of the xml element using xpath.

Convert Sql DataBase Tables to Xml

select * from emp for xml auto