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
 insert into table

Author  Topic 

anand.mind
Starting Member

4 Posts

Posted - 2008-03-19 : 09:21:28
I have a table with two columns. I have to insert data in one column from another table and in another column a general scalar value. As like the following..
insert into <table1>(column1,column2)values(select columnX from <table2>,XYZ)
But I couldn't do this because values clause doesn't support select statement. So,please suggest me how can I do this.....

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-03-19 : 09:23:40
[code]insert into <table1>(column1,column2)
select columnX, XYZ from table2>[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2008-03-19 : 10:04:20
Are you a DB2 VET?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -