Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server: Msg 207. 2

Status
Not open for further replies.

Eldaria

Programmer
Sep 20, 2001
123
NL
When executing following SQL:

Delete FROM tbl_Genre
WHERE (tbl_genre.GenID = 9)

I get this?

Server: Msg 207, Level 16, State 3, Procedure T_tbl_Genre_DTrig, Line 4
Invalid column name 'GenID'.

but a slight modification of the SQL:

Select * FROM tbl_Genre
WHERE (tbl_genre.GenID = 9)

Now It shows the row I want to delete.

I have no relationships to the table.
I have tried to delete from Enterprise Manager, and from Query Analyzer, but still same error. Can not find Column GenID
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
I am no expert, but it looks like you're trigger that occurs when you delete a record from the tbl_Genre table is where the problem is and not you're delete.
 
The problem is not your delete statement, it is a problem with a trigger called T_tbl_Genre_DTrig that is attached to the table. Check the code on line 4 of this trigger for the problem.

Chris.
 
Trigger?
How do I find the trigger?
As far as I know I have not added anything called a trigger.

I'm not very experienced with SQL server (Yet) but I'm learning. :)
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
Aha found it, It was the triggers...

And yes I found the triggers also. :)

Even if I had removed the relation ship it kept the trigger that checks for relationships.

Thanks guys...
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top