What is the wrong with this SQL?
From: Ram Kumar Koditala (RamKumarKoditala_at_discussions.microsoft.com)
Date: 11/12/04
- Next message: Adam Machanic: "Re: Dynamic SQL Execution"
- Previous message: Alejandro Mesa: "Re: Select fails with "Arithmetic overflow" after indexing a decim"
- Next in thread: Mal .mullerjannie_at_hotmail.com>: "RE: What is the wrong with this SQL?"
- Reply: Mal .mullerjannie_at_hotmail.com>: "RE: What is the wrong with this SQL?"
- Reply: Aaron [SQL Server MVP]: "Re: What is the wrong with this SQL?"
- Reply: Anith Sen: "Re: What is the wrong with this SQL?"
- Reply: Mal .mullerjannie_at_hotmail.com>: "RE: What is the wrong with this SQL?"
- Reply: Gert-Jan Strik: "Re: What is the wrong with this SQL?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 12 Nov 2004 08:55:06 -0800
When I run the following SQL
create table dest
(col1 int
,col2 int
,col3 int
)
go
create table src
(col1 int
,col2 int
,col3 int
)
go
print ('insert')
insert into src values(1,2,3)
go
begin tran
update src
set col1 = col2
insert into dest
select col1, col2, col3 from src
commit tran
print ('Drop')
-- the following needs to be done if the above trans goes well
alter table src drop column col2
alter table src drop column col3
there is an error saying that …
Server: Msg 207, Level 16, State 3, Line 6
Invalid column name 'col2'.
When I double click on the error row the cursor is going to the SQL
statement where data is inserted from src to dest
Thanks for your help
- Next message: Adam Machanic: "Re: Dynamic SQL Execution"
- Previous message: Alejandro Mesa: "Re: Select fails with "Arithmetic overflow" after indexing a decim"
- Next in thread: Mal .mullerjannie_at_hotmail.com>: "RE: What is the wrong with this SQL?"
- Reply: Mal .mullerjannie_at_hotmail.com>: "RE: What is the wrong with this SQL?"
- Reply: Aaron [SQL Server MVP]: "Re: What is the wrong with this SQL?"
- Reply: Anith Sen: "Re: What is the wrong with this SQL?"
- Reply: Mal .mullerjannie_at_hotmail.com>: "RE: What is the wrong with this SQL?"
- Reply: Gert-Jan Strik: "Re: What is the wrong with this SQL?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|