how to debug a T-SQL trigger in visual studio?

Posted on 2014-08-06
Last Modified: 2015-10-19
I have sql 2014
and a console app

the console app inserts data into a table
Then the trigger fires when any row is added, and adds data to various other tables

the data is never arriving in the other tables, so the trigger is failing
How can I debug and step through the trigger when using the console app? so i can see where its failing?
Question by:websss
    LVL 14

    Accepted Solution


    Hope the following article will give you some idea for Debugging SQL trigger.

    Hope it would help

    Author Comment

    I get the error when opening the trigger in VS2013

    Could not retrieve the definition of [dbo].[Trig_Trackin] from the server

    LVL 4

    Expert Comment

    by:Steven Kribbe
    Could you post the trigger code? I would definitely check access rights to the tables you are trying to populate in the trigger.  Is the trigger code working if you run it outside the trigger?

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now