June 25, 2018 at 1:27 am
Hi All,
I'm trying to create an After Insert in SQL Server 2008 R2 with the code below. The user I'm logging in has db_datareader and db_datawriter roles assigned but for some reason the Tables folder shows no objects but sysobjects shows the object is there. Below is the code I'm using :
CREATE TRIGGER TrggrName
ON [TableName]
AFTER INSERT AS
BEGIN
Exec [dbo].[StoreProcedure]
END
GO
I get this error below
Msg 8197, Level 16, State 4, Procedure TrggrName, Line 1
The object 'TableName' does not exist or is invalid for this operation.
Any help is appreciable.
Thank You
Arsh
June 25, 2018 at 2:07 am
What do you get if you run this?
SELECT
entity_name
, subentity_name
, permission_name
FROM fn_my_permissions ( TableName , 'OBJECT' )
John
June 25, 2018 at 2:36 am
John Mitchell-245523 - Monday, June 25, 2018 2:07 AMWhat do you get if you run this?
SELECT
entity_name
, subentity_name
, permission_name
FROM fn_my_permissions ( TableName , 'OBJECT' )John
Hi John ,
Thanks for the reply. The query returns nothings. Also its a 'intellisense' issue for which I m installing V Studio . |tried alternatively from command prompt but bcos I've only the db_datareader and db_datawriter roles , I get permissions error. Will fix these and let know. Can drop any comments meanwhile.
Thanks...Arshad
June 25, 2018 at 6:24 am
Arsh - Monday, June 25, 2018 1:27 AMHi All,
I'm trying to create an After Insert in SQL Server 2008 R2 with the code below. The user I'm logging in has db_datareader and db_datawriter roles assigned but for some reason the Tables folder shows no objects but sysobjects shows the object is there. Below is the code I'm using :
CREATE TRIGGER TrggrNameON [TableName]
AFTER INSERT AS
BEGIN
Exec [dbo].[StoreProcedure]
END
GO
I get this error below
Msg 8197, Level 16, State 4, Procedure TrggrName, Line 1
The object 'TableName' does not exist or is invalid for this operation.
Any help is appreciable.
Thank You
Arsh
Is "TableName" the actual name of the table you're trying to attach the trigger to?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 1, 2018 at 12:01 am
Jeff Moden - Monday, June 25, 2018 6:24 AMArsh - Monday, June 25, 2018 1:27 AMHi All,
I'm trying to create an After Insert in SQL Server 2008 R2 with the code below. The user I'm logging in has db_datareader and db_datawriter roles assigned but for some reason the Tables folder shows no objects but sysobjects shows the object is there. Below is the code I'm using :
CREATE TRIGGER TrggrNameON [TableName]
AFTER INSERT AS
BEGIN
Exec [dbo].[StoreProcedure]
END
GO
I get this error below
Msg 8197, Level 16, State 4, Procedure TrggrName, Line 1
The object 'TableName' does not exist or is invalid for this operation.
Any help is appreciable.
Thank You
ArshIs "TableName" the actual name of the table you're trying to attach the trigger to?
Hi Jeff and John. Thanks for the advices . The issue was with Intellisense. Setting up SQL server 2017 resolved the issue.
Best Regards,
Arshad
July 3, 2018 at 2:19 am
Arsh - Sunday, July 1, 2018 12:01 AMJeff Moden - Monday, June 25, 2018 6:24 AMArsh - Monday, June 25, 2018 1:27 AMHi All,
I'm trying to create an After Insert in SQL Server 2008 R2 with the code below. The user I'm logging in has db_datareader and db_datawriter roles assigned but for some reason the Tables folder shows no objects but sysobjects shows the object is there. Below is the code I'm using :
CREATE TRIGGER TrggrNameON [TableName]
AFTER INSERT AS
BEGIN
Exec [dbo].[StoreProcedure]
END
GO
I get this error below
Msg 8197, Level 16, State 4, Procedure TrggrName, Line 1
The object 'TableName' does not exist or is invalid for this operation.
Any help is appreciable.
Thank You
ArshIs "TableName" the actual name of the table you're trying to attach the trigger to?
Hi Jeff and John. Thanks for the advices . The issue was with Intellisense. Setting up SQL server 2017 resolved the issue.
Best Regards,
Arshad
I mean installing the SQL Client 2017 resolved the issue.
July 3, 2018 at 6:22 am
Arsh - Tuesday, July 3, 2018 2:19 AMArsh - Sunday, July 1, 2018 12:01 AMJeff Moden - Monday, June 25, 2018 6:24 AMArsh - Monday, June 25, 2018 1:27 AMHi All,
I'm trying to create an After Insert in SQL Server 2008 R2 with the code below. The user I'm logging in has db_datareader and db_datawriter roles assigned but for some reason the Tables folder shows no objects but sysobjects shows the object is there. Below is the code I'm using :
CREATE TRIGGER TrggrNameON [TableName]
AFTER INSERT AS
BEGIN
Exec [dbo].[StoreProcedure]
END
GO
I get this error below
Msg 8197, Level 16, State 4, Procedure TrggrName, Line 1
The object 'TableName' does not exist or is invalid for this operation.
Any help is appreciable.
Thank You
ArshIs "TableName" the actual name of the table you're trying to attach the trigger to?
Hi Jeff and John. Thanks for the advices . The issue was with Intellisense. Setting up SQL server 2017 resolved the issue.
Best Regards,
Arshad
I mean installing the SQL Client 2017 resolved the issue.
Arsh - Tuesday, July 3, 2018 2:19 AMArsh - Sunday, July 1, 2018 12:01 AMJeff Moden - Monday, June 25, 2018 6:24 AMArsh - Monday, June 25, 2018 1:27 AMHi All,
I'm trying to create an After Insert in SQL Server 2008 R2 with the code below. The user I'm logging in has db_datareader and db_datawriter roles assigned but for some reason the Tables folder shows no objects but sysobjects shows the object is there. Below is the code I'm using :
CREATE TRIGGER TrggrNameON [TableName]
AFTER INSERT AS
BEGIN
Exec [dbo].[StoreProcedure]
END
GO
I get this error below
Msg 8197, Level 16, State 4, Procedure TrggrName, Line 1
The object 'TableName' does not exist or is invalid for this operation.
Any help is appreciable.
Thank You
ArshIs "TableName" the actual name of the table you're trying to attach the trigger to?
Hi Jeff and John. Thanks for the advices . The issue was with Intellisense. Setting up SQL server 2017 resolved the issue.
Best Regards,
Arshad
I mean installing the SQL Client 2017 resolved the issue.
K... but I'm confused. Your trigger code was creating a trigger on a table named "TableName" and you got an error saying that table didn't exist. I'd bet that table name still doesn't exist. How did installing the SQL Client 2017 fix THAT problem?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply