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

  • SEARCH
  • Home
  • 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 79951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:13:34+00:00 2026-05-10T21:13:34+00:00

I need to alter a trigger in sql server 2005 and I want to

  • 0

I need to alter a trigger in sql server 2005 and I want to do it using a table adapter and a sql statement, not a stored proc. I know I could run this in the query browser and execute it but I need to deploy it across several databases and use a table adapter in the update. Is this possible?

Doing Add Query -> Update -> pasting the below code -> Query Builder to see if it parses

print('USE [DataBaseName] GO /****** Object:  Trigger [dbo].[UpdateCurrentAddress]    Script Date: 10/30/2008 14:47:15 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER TRIGGER [dbo].[UpdateCurrentAddress] ON [dbo].[PreviousAddresses]  FOR INSERT, UPDATE, DELETE AS -- Check to see if there was an insert/update or a deletion. IF (SELECT COUNT(*) FROM inserted) >= 1 BEGIN     IF (SELECT CountryID FROM inserted) <> 181  ...moar...'); 

error… The USE [DataBaseName] SQL construct or statement is not supported.

and if i remove the top part and start at just ALTER TRIGGER

The ALTER TRIGGER SQL construct or statement is not supported.

I’m still fairly new to this and would not be surprised that either I’m either going about this the wrong way and/or it’s impossible to do without a stored proc.

EDIT: Yeah I’m doing this in C#.

thanks. I can do it that way starting at ALTER TRIGGER, this will get the job done.

  • 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-10T21:13:35+00:00Added an answer on May 10, 2026 at 9:13 pm

    The TableAdapter is expecting a resultset, not an actual query. To do this successfully you will need to use the SqlCommand object to actually peform your update.

    If you have not used one before it is quite simple, first you declare your connection, then you create your command using the connection. Once the command is created set the commandtext equal to your script, and then you can call the ExecuteNonQuery() method to run the script after opening the connection. If you say what language you are using, I can try to provide an example.

    Edit

    Here is a C# example, quick and dirty but it gets the point across. NOTE, done from memory, but should be correct.

    using(SqlConnection oConnection = new SqlConnection('Yourconnectionhere')) using(SqlCommand oCommand = new SqlCommand(oConnection)) {     //Configure the command object     oCommand.CommandText = 'Your script here';      //Open connectin and run script     oConnection.Open();     oCommand.ExecuteNonQuery();     oConnection.Close(); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 104k
  • Answers 104k
  • 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
  • Editorial Team
    Editorial Team added an answer You could always use the Enum with Visitor pattern: enum… May 11, 2026 at 8:33 pm
  • Editorial Team
    Editorial Team added an answer It seemed to me that both profiles offer similar levels… May 11, 2026 at 8:33 pm
  • Editorial Team
    Editorial Team added an answer A query like that seems to indicate to me that… May 11, 2026 at 8:33 pm

Related Questions

I have been tasked with developing a solution that tracks changes to a database.
Is there a client event that I can use for when a DropDownList's data
I'm trying to enforce integrity on a table in a way which I do
I have a Form in my application that displays some data. When I first

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.