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
 Transact-SQL (2000)
 Insert into statement

Author  Topic 

dougancil
Posting Yak Master

217 Posts

Posted - 2010-10-04 : 11:49:50
I'm pretty sure this is an easy question, but I have the following query:

Insert Into Scratchpad1 (Employeenumber, Name, Exceptiondate, Starttime, MinutesPaid)
SELECT EmployeeNumber, Name, exceptiondate, StartTime, MinutesPaid
From Scratchpad2

and when I run this query I get the following error:
Server: Msg 207, Level 16, State 1, Line 1
Invalid column name 'Exceptiondate'.

Can someone please tell me what I'm missing?

Thank you

Doug

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-04 : 12:09:45
it means that there is no column called Exceptiondate in Scratchpad1. Check your spelling on the column name
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-04 : 13:44:58
quote:

SELECT EmployeeNumber, Name, exceptiondate, StartTime, MinutesPaid
From Scratchpad2


or may be Scratchpad2 doesn't have exceptiondate column.

Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-04 : 15:36:39
quote:
Originally posted by pk_bohra

quote:

SELECT EmployeeNumber, Name, exceptiondate, StartTime, MinutesPaid
From Scratchpad2


or may be Scratchpad2 doesn't have exceptiondate column.





No, because the error is on line 1.
Go to Top of Page

dougancil
Posting Yak Master

217 Posts

Posted - 2010-10-04 : 16:21:28
It is because that column is missing. It was an oversight on my part. I apologize for opening this question.
Go to Top of Page
   

- Advertisement -