Exec Trigger On Import

  • Hi,

    I am running a POC database on my desktop using SQL Server Express 2012. I have created some triggers that work when I manually run a DML statement but do not seem to run when I use the Import Query. Is it possible to run a trigger based on Import?

    Thanks,

    J

  • bump

  • jeandlauro (12/24/2013)


    Hi,

    I am running a POC database on my desktop using SQL Server Express 2012. I have created some triggers that work when I manually run a DML statement but do not seem to run when I use the Import Query. Is it possible to run a trigger based on Import?

    Thanks,

    J

    When you say you are using an Import Query, what exactly are you using?

  • SSMS. I am new to SQL Server. Is there better software to do this?

  • I believe that Lynn was referring to what command did you use (eg. INSERT INTO, BULK INSERT, bcp, etc).

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • I'm using the SQL Server Import and Export Wizard.

    Is there a way to write SQL to import from Excel using SS Express?

  • jeandlauro (12/31/2013)


    I'm using the SQL Server Import and Export Wizard.

    Is there a way to write SQL to import from Excel using SS Express?

    The import/export wizard uses SSIS behind the scenes. SSIS does not fire triggers unless configured to do so. If I remember correctly the import/export wizard does not provide a means to set the package to fire triggers. You would have to save the package and then edit it using BIDS.

  • Thank you!

    I am trying to use Bulk insert query instead.

  • Remember to use the option to enable triggers (FIRE_TRIGGERS) or the result will be the same.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • actually I've spent a lot of hours looking for a solution to query xls from SSMS. In MS Access you can link xls. In Excel you can link just about anything very easily. Why is it so complicated with SQL Express?

  • Because you are now working with SQL Server, not a desktop application.

  • I just mean I thought it would be easier to link Microsoft data tools together.

  • Okay, you are missing the point. Even though SQL Server Express can be used as a Desktop database system, it is a full blown RDBM system. It is the same engine used by the Standard and Enterprise editions of SQL Server, just not all of the functionality is available, just as not all features are available in the Standard Edition that are available in the Enterprise Edition. The type of integration you see within the Microsoft Office applications is not a part of SQL Server.

  • jeandlauro (1/6/2014)


    I just mean I thought it would be easier to link Microsoft data tools together.

    I've been wondering the same thing for years (almost 2 decades, now). When I've asked about it, their answer is to use SSIS... I don't care for that particular application but I've stopped asking "why" about things like this.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply