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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Simple Q

Author  Topic 

Saeed
Starting Member

39 Posts

Posted - 2002-09-25 : 20:58:52


trying to copy everything from table1 into table2 as well as updating one extra into table2

is this gonna work?

Insert INTO table1 select table2 ,@userID

where UserID is that extra one column

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-09-25 : 21:53:36
Did you try it first ?

Damian
Go to Top of Page

Tim
Starting Member

392 Posts

Posted - 2002-09-25 : 22:49:34
I am thinking of asking my boss for a raise. Do you think that will work?

----
Nancy Davolio: Best looking chick at Northwind 1992-2000
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-09-25 : 23:39:58
Outlook not good

Damian
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2002-09-26 : 06:50:24
try this

begin tran
Insert INTO table1 select table2 ,@userID
where UserID is that extra one column

select * from table1
rollback tran

It will lock things up so don't do it while there are users on the system.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -