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)
 Attempting to use INSERT INTO...SELECT

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-12-04 : 16:51:02
Adam writes "Hi,

Whilst I can find out how to use Insert Into...Values in an ASP Page, I dont seem to be able to find any info on Insert Into...Select. I'm writing some ASP code to try and copy most of one record from one table to itself, changing some info along the way, and I wanted to send an Insert Into...Select command (which works perfectly well in Access - I tried it in the exact context), to save me having to retrieve each record one at a time, and then insert them one at a time.

I'm getting VBScript errors requiring an object. I'm trying to do this....

INSERT INTO CarOwn ( StaffNo, Person, CarID, TeamID, OwnType, Forecast, TempCar, Archive, Scenario) SELECT CarOwn.StaffNo, CarOwn.Person, CarOwn.CarID, CarOwn.TeamID, CarOwn.OwnType, CarOwn.Forecast, CarOwn.TempCar, CarOwn.Archive, 'cucumber' AS Scenario FROM CarOwn WHERE ((CarOwn.OwnerID=486));

where 'cucumber' is what i'm trying to change and 486 is any random number from the primary key of the table.

If this isnt a relevant question for you, then blame 4guysfromrolla.com where I found this link...

ta

adam
"
   

- Advertisement -