Saturday, June 22, 2013

[SQL Server] selecting same columns

[SQL Server] selecting same columns


selecting same columns

Posted: 22 Jun 2013 01:00 AM PDT

Hi All - I have come across a query in a site like below:if OBJECT_ID('tempdb..#t1') is not nulldrop table #t1SELECT TOP 11000 IDENTITY(INT,1,1) AS N INTO #t1 FROM Master.dbo.SysColumns sc1, Master.dbo.SysColumns sc2I have a doubt on the part: FROM Master.dbo.SysColumns sc1, Master.dbo.SysColumns sc2 - How it works? what is the logic behind this?I tried to select like: select * from Master.dbo.SysColumns sc1, Master.dbo.SysColumns sc2 - seems endless loop. Is it so? Can someone please clarify how it works. Thanks!

No comments:

Post a Comment

Search This Blog