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
 use select staement results in a stored procedure

Author  Topic 

actiondriver
Starting Member

1 Post

Posted - 2006-01-10 : 04:08:54
Hi.

I am new to SQl server. I would like to write a query with the follwing logic:
---------
Select department from table1;

then insert each result row into a table with in the same query.
---------

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-01-10 : 04:10:34
Select department into yourNewTable from table1

Go with the flow & have fun! Else fight the flow
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-10 : 04:13:11
If you have already created new table, then

Insert into newTable(department)
Select department from table1

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -