Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select question 1

Status
Not open for further replies.

ArizonaRedneck

Programmer
Oct 25, 2004
61
0
0
US
hello. I have 2 databases located on a local SQL server. one is called Store and one is called StoreDevel. My question is how would I select from a table in the Store Database and insert the records into a table int the StoreDevel database? Here's what it looks like so far...
Code:
INSERT INTO VendorUPC (VendorID,UPC_Code)

select 33 as VendorID, [UPC Code] as UPC_Code
from Store.BNFusa

Thanks for you help.

-
"Do your duty in all things. You cannot do more, you should never wish to do less." Robert E. Lee
 
I think you just have to use their full name
Code:
INSERT INTO myserver.mydb.VendorUPC (VendorID,UPC_Code)
select 33 as VendorID, [UPC Code] as UPC_Code
from myserver.Store.BNFusa
something like that
 


try this:

INSERT INTO storedevel.dbo.VendorUPC (VendorID,UPC_Code)
select 33 as VendorID, [UPC Code] as UPC_Code
from Store.dbo.BNFusa
 
Thanks maswien that worked great. I really appreciate it.

-
"Do your duty in all things. You cannot do more, you should never wish to do less." Robert E. Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top