Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 117801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:23:38+00:00 2026-05-11T03:23:38+00:00

This question is very similar to SQL Server 2005: T-SQL to temporarily disable a

  • 0

This question is very similar to SQL Server 2005: T-SQL to temporarily disable a trigger

However I do not want to disable all triggers and not even for a batch of commands, but just for one single INSERT.

I have to deal with a shop system where the original author put some application logic into a trigger (bad idea!). That application logic works fine as long as you don’t try to insert data in another way than the original ‘administration frontend’. My job is to write an ‘import from staging system’ tool, so I have all data ready. When I try to insert it, the trigger overwrites the existing Product Code (not the IDENTITY numeric ID!) with a generated one. To generate the Code it uses the autogenerated ID of an insert to another table, so that I can’t even work with the @@IDENTITY to find my just inserted column and UPDATE the inserted row with the actual Product Code.

Any way that I can go to avoid extremly awkward code (INSERT some random characters into the product name and then try to find the row with the random characters to update it).

So: Is there a way to disable triggers (even just one) for just one INSERT?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:23:38+00:00Added an answer on May 11, 2026 at 3:23 am

    You can disable triggers on a table using:

    ALTER TABLE MyTable DISABLE TRIGGER ALL 

    But that would do it for all sessions, not just your current connection.. which is obviously a very bad thing to do 🙂

    The best way would be to alter the trigger itself so it makes the decision if it needs to run, whether that be with an ‘insert type’ flag on the table or some other means if you are already storing a type of some sort.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Yes, there is a way. Download AutoHotKey. Save this as… May 11, 2026 at 3:51 pm
  • added an answer They're over-engineered and it was my biggest issue with it,… May 11, 2026 at 3:51 pm
  • added an answer Look at oprofile. I think it does exactly what you… May 11, 2026 at 3:51 pm

Related Questions

I have a SQL Server 2005 database that is linked to an Oracle database.
I need to make a rather complex query, and I need help bad. Below
I have been supporting a web application at work for our Call Center unit
Two questions: Can someone point me to unbiased data that compares .NET performance to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.