SQL Trigger Problem from .NET Assembly during deployment

Hi,

I have a function with the attribute of [SQLTrigger] and trying to deploy it to the database, i get an error saying that can't deploy the function.

Hence i coded as the following

create trigger Write2Log on sales.salesorderheader for update
as External name sqldbproj.[namespace.class].Write2Lg

can any one suggest me as why this deployment is not allowed from the Visual Studio

Regards,



Answer this question

SQL Trigger Problem from .NET Assembly during deployment

  • WNeidigh

    Thanks Niels.

    Can you throw some light on the project templates and deployment tool for VS, that you mention about....

    Secondly, is there any possiblity about how to get to know the new release information... in other words, is there any mailing list that i have to subscribe to get the release information or any other mechanism

    Regards,

  • Charsoft

    Here is the actual code snippet from the solution file.

    [SqlTrigger(Event="FOR UPDATE",Target="Sales.SalesOrderHeader")]
    public static void WriteToLog()
     {
      System.Diagnostics.EventLog.WriteEntry("Status", "Table Updated");
     }

    Regards,


  • SquareDanceSteve

    That's correct. But how to associate the corrosponding attribute for the function in the Visual Studio solution

    Anyhow, thaks for reply.

    Regards

  • AsgerM

    I assume that the first code snippet you wrote; CREATE TRIGGER .... works fine when you run it manually from Management Studio or something similar, but that the automatic deployment from VS as per the second code snippet doesn't work If that's the case, this is a case of missing functionality in the deployement functions inside of Visual Studio. I.e. it does not understand schema qualification.

    Niels

  • Szász Bence

     Chakravarthy wrote:
    That's correct. But how to associate the corrosponding attribute for the function in the Visual Studio solution


    Unfortunately you can't. I have created my own project templates and deployment tool for VS, and in the next version, it'll support your issue, as well as deploying procs/functions etc to different schemas than default. This version will be released within a couple of days.

    Niels

  • SamC

     Chakravarthy wrote:
    Thanks Niels.

    Can you throw some light on the project templates and deployment tool for VS, that you mention about....

    Secondly, is there any possiblity about how to get to know the new release information... in other words, is there any mailing list that i have to subscribe to get the release information or any other mechanism

    Sure, you can download the existing version from here. To hear about when a new version is released, check my blog.

    Niels


  • SQL Trigger Problem from .NET Assembly during deployment