Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy and modify a set of rows into the source table
Message
 
 
À
31/01/2011 11:31:21
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01497974
Message ID:
01497979
Vues:
42
You can use SELECT INTO a temp table, update one of the columns and do INSERT INTO ... SELECT FROM the temp table.


>Thanks for the reply Sergey
>
>These table are subject to frequent addition of columns, so I was hoping to find a way to do it without specifying all the columns - something like SCATTER and GATHER
>
>
>NSERT INTO mytable
>SELECT col1, col2, <newValueCol3>, col4, col5, ...
>  FROM mytable
>  WHERE Col3 = <ValueCol3>, ColN = <ValueColN>
>
>
>>I need to select a set of rows from a table, based on two columns
>>, give one of those columns a new value in the selected set, and then insert the selected set into the source table.
>>I can bring them down from the server, do the changes and then insert them one at a time, but I'm not crazy about that all those trips to and from the server, I'd rather do it all on the server, but can't figure out how
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform