RSS Forums RSS
Please support our MS SQL advertiser: Programming Forums

INSERT CLAUSE using SUB-QUERY

Join Date: Feb 2005
Posts: 175
Reputation: Letscode is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
Letscode's Avatar
Letscode Letscode is offline Offline
Junior Poster

INSERT CLAUSE using SUB-QUERY

  #1  
Oct 18th, 2005
I'm trying to populate a table from a sub-query.

CREATE TABLE test
(
ID int
)


INSERT INTO test
VALUES (SELECT [Customer Id] 
FROM   [Customers])


QUESTION:
I know you can do this in ORACLE but Is something like this possible in T-SQL.

I can also write something like this in SQL which achieves the same result but I will lose the datatype,

SELECT [Customer Id] 
INTO test
FROM   [Customers]


Any suggestions is greatly appreciated.
Save White Tiger
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:49 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC