December 5, 2012 at 6:31 am
Hi Grant, I get the followign errors when running this:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'TRANS'.
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near 'TRANS'.
December 5, 2012 at 6:35 am
Ok fixed it by replacing TRANS with TRANSACTION :0)
December 5, 2012 at 6:41 am
grrr I am using the following syntax:
BEGIN TRANSACTION
UPDATE dbo.attcat
SET Val = 50
WHERE ID = i_att_type;
--ROLLBACK TRANS
But keep getting:
Msg 207, Level 16, State 1, Line 2
Invalid column name 'ID'.
December 5, 2012 at 6:49 am
david.williams 50026 (12/5/2012)
grrr I am using the following syntax:BEGIN TRANSACTION
UPDATE dbo.attcat
SET Val = 50
WHERE ID = i_att_type;
--ROLLBACK TRANS
But keep getting:
Msg 207, Level 16, State 1, Line 2
Invalid column name 'ID'.
Is ID a column in your table? I just used that as an example.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
December 5, 2012 at 6:58 am
No but i_att_type IS a column, how do I tell it to use that? I thought WHERE ID = i_att_type; was telling it WHERE to update?
December 5, 2012 at 7:00 am
david.williams 50026 (12/5/2012)
No but i_att_type IS a column, how do I tell it to use that? I thought WHERE ID = i_att_type; was telling it WHERE to update?
No, it would be i_att_type = SomeValue. ID would have to be 'ID' to be used as a string.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
December 5, 2012 at 7:57 am
Grant Fritchey (12/5/2012)
david.williams 50026 (12/5/2012)
No but i_att_type IS a column, how do I tell it to use that? I thought WHERE ID = i_att_type; was telling it WHERE to update?No, it would be i_att_type = SomeValue. ID would have to be 'ID' to be used as a string.
Ummmm not wishing to appear dense here (but probably am looking that way!) what would "SomeValue" be?!
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply