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 stat with different value in one column

Author  Topic 

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2011-08-03 : 11:36:41
Hello everyone.

I want to perform an insert statement. all values are the same bar one. for example

insert table values ('column1', 'column2', 'column3', @member_ref)

So columns 1 to 3 will be the same but there will be about 200 member refs to insert.

how would i go about this. member ref will come from a seperate table ie a select statement.

Could someone give me a example of how i could do this please.

Many thanks

Rob

MCTS / MCITP certified

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-03 : 12:35:13
it should be


insert table
select 'column1', 'column2', 'column3', member_ref
from othertable


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

Go to Top of Page
   

- Advertisement -