Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Calendar Table

Author  Topic 

sanjay5219
Posting Yak Master

240 Posts

Posted - 2010-11-27 : 04:05:45
HI All,

I have one calendar table and one std_mstr table(with 4 record).
Std_ID,Std_Name now i want to insert record in this manner in test table (Calendar_Table.Day,Std_Id,Std-Name) so if i have 30 rows in my table then in my test table i should have 120 rows in my test table.

Please suggesrt

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-11-27 : 04:07:41
[code]
INSERT INTO Test
SELECT c.Day,s.Std_ID,s.Std_Name
FROM Calendar_Table c
CROSS JOIN std_mstr s
[/code]


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -