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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-04-01 : 09:12:26
|
| Summer writes "Hei!I think that this is what I basicly need. But I cant get it work in my stored prosedure, MS server 7.0'From Books online**The SELECT INTO statement retrieves one row of results. The SELECT INTO statement is also known as a singleton SELECT statement.SyntaxSELECT [select_list] INTO {:hvar [,...]} select_optionsSELECT au_lname INTO :name FROM authors WHERE stor_id=:id;**I want to copy one row in my database, and change primary key (example id + 1).How should I do it then?T:Summer" |
|
|
Jay99
468 Posts |
Posted - 2002-04-01 : 10:00:47
|
| Post your CREATE TABLE statement (DDL).Where do you want to 'paste' the row that you 'copy'?Jay<O> |
 |
|
|
Summer
Starting Member
7 Posts |
Posted - 2002-04-02 : 00:33:02
|
quote: Post your CREATE TABLE statement (DDL).Where do you want to 'paste' the row that you 'copy'?Jay<O>
In that same table. I want make "basis/background" for my new order from old order(for example).I think that is quite normal function, but I dont figure it out.If possible, i dont want any new tablesregardsSummer |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-04-02 : 01:44:34
|
AhhhYou want to do something likeINSERT INTO Orders (CustomerID, PartID)SELECT CustomerID, PartIDFROM Orders WHERE OrderID = 1 That should do it.Damian |
 |
|
|
Summer
Starting Member
7 Posts |
Posted - 2002-04-04 : 03:16:48
|
| Thanks very much!That's what I was looking forSummer |
 |
|
|
|
|
|