3rd highest salary in sql server

How to see the values of a table variable at debug time in T-SQL?

SQL Server Query

DECLARE @DATE AS DATETIME
       SET @DATE = GETDATE()
SELECT @DATE as Todays

DECLARE @USERS AS TABLE(UserId INT, Name NVARCHAR(255))
       INSERT @USERS VALUES(1001, 'Anil Singh')
       INSERT @USERS VALUES(1002, 'Sunil Singh')
       INSERT @USERS VALUES(1003, 'Sushil Singh')

DECLARE @UserXML XML = (SELECT * FROM @USERS FOR XML AUTO)

SELECT * FROM @USERS
SELECT @UserXML as UserAsXML_Formatt


The output as see below

ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Buy Books Online at Best Prices

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.