sushantkatte (8/1/2015)
Thank You very much @SScrazy for providing the solution. i am very new to the sql server programming and have started learning recently. could you please help me understand the logic of script that you provided and how it works?Actually this question was asked to me in an interview
Now that you have answers, I'm curious... how is it that you're applying for a job that requires knowledge of T-SQL while you have virtually none? Does your resume say that you've worked with T-SQL to any extent? Did you tell the interviewer that you were just getting started in the world of SQL Server?
--Jeff Moden
Change is inevitable... Change for the better is not.