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
 select ....insert

Author  Topic 

ratheeshknair
Posting Yak Master

129 Posts

Posted - 2008-06-10 : 23:58:00
Hi Experts,
Is it possible to insert a select statement directly to a table.


TIA:)

RKNAIR

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-11 : 00:12:25
Yup you can use
INSERT INTO Table
SELECT statement

but make sure the select statement contains the same number and same datatype columns as per table definition.
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2008-06-11 : 00:44:35
insert into your_table select 'your_select_statement'
go

Arnav
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page

ratheeshknair
Posting Yak Master

129 Posts

Posted - 2008-06-11 : 01:42:59
Thanks :-)

RKNAIR
Go to Top of Page
   

- Advertisement -