Sunday, March 11, 2012

CLR SqlTrigger and Schemas

I cannot get a Trigger to work on a schema table set that is not dbo. For
example with AdventureWorks if I used:
<Microsoft.SqlServer.Server.SqlTrigger(Name:="utrigPersonas",
Target:="Person.Address", Event:="FOR UPDATE")>
When I try to deploy this it returns the error:
Cannot find the object "Persona.Address" because it does not exist or you do
not have permissions.
Can you not create CLR triggers with tables that use schemas other than dbo?You can, but Visual Studio can't -- deploy it yourself (use CREATE ASSEMBLY,
then CREATE TRIGGER) and you should have no problems.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"developer@.stf.com" <developer@.stf.com@.discussions.microsoft.com> wrote in
message news:8F71BCCD-3F05-4CAE-9772-B8483658910A@.microsoft.com...
>I cannot get a Trigger to work on a schema table set that is not dbo. For
> example with AdventureWorks if I used:
> <Microsoft.SqlServer.Server.SqlTrigger(Name:="utrigPersonas",
> Target:="Person.Address", Event:="FOR UPDATE")>
> When I try to deploy this it returns the error:
> Cannot find the object "Persona.Address" because it does not exist or you
> do
> not have permissions.
> Can you not create CLR triggers with tables that use schemas other than
> dbo?

No comments:

Post a Comment