Results 1 to 4 of 4

Thread: Triggers on SQL-Server (RESOLVED)

  1. #1

    Thread Starter
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478

    Triggers on SQL-Server (RESOLVED)

    Anyone know how i can retrieve the tables where there are triggers set through code.

    I need to transfer data from Access db to SQL-Server db.
    The triggers should be set OFF to transfer all data and after tranfer is done they must be set ON.

    Can this be done and how.

    I don't want to use enterprise manager to check all them tables.
    Last edited by swatty; Feb 5th, 2003 at 10:17 AM.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  2. #2
    Fanatic Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    855
    try
    ALTER TRIGGER trigger_name DISABLE;
    VB 6.0, Access, Sql server, Asp

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Originally posted by ralph
    try
    ALTER TRIGGER trigger_name DISABLE;
    Right, but he needs trigger_name first.....

    Try doing a SELECT * FROM sysobjects and see what gets returned. Then add WHERE clauses to return only triggers. Try using the xtype .... I know that 'U' = User table, 'P' = stored proc, 'F' = Function, 'V' = View.... hope that helps......
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    Owe you one.

    xtype 'TR' = trigger

    correct syntax is
    VB Code:
    1. [COLOR=blue]ALTER TABLE[/COLOR]  table_name DISABLE [COLOR=blue]TRIGGER[/COLOR]  trigger_name
    Last edited by swatty; Feb 5th, 2003 at 10:43 AM.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width