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 881343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:14:41+00:00 2026-05-15T12:14:41+00:00

I have a set of sql scripts which I send to SQL server using

  • 0

I have a set of sql scripts which I send to SQL server using a SqlCommand object in C#. These scripts create stored procedures and as long as I just create the procedures, everything works finde. If my scripts contain the usual “if exists … drop XYZ; create procedure XYZ …” block, I get an error which tells me, that create must be the first statement in a batch. Neither semicolon nor “GO” work as separator.

Any hint how to execute such a script using a single SqlCommand? I have expected to be able to set a property to “Batch” or something like that, but I did not found anything.

  • 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. Editorial Team
    Editorial Team
    2026-05-15T12:14:42+00:00Added an answer on May 15, 2026 at 12:14 pm

    The conflicting statements must either be separated by a batch separator (default GO – which you say doesn’t work), or, if possible from the point of view of your program logic executed in a different order. However, in most case restructuring of the order of statements will not be possible so that you have to resort to the separation in different batches so I would suggest running them in different batches.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer By casting the resultExecutingContext.Controller to BaseController you can access through… May 16, 2026 at 11:11 am
  • Editorial Team
    Editorial Team added an answer I think I found the answer to the setting maximum… May 16, 2026 at 11:11 am
  • Editorial Team
    Editorial Team added an answer It's in SI lux units (m/s2). May 16, 2026 at 11:11 am

Trending Tags

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

Top Members

Related Questions

We have mirroring set up between 2 SQL Server 2005 standard editions. There are
Could I use migrator.net bare migration framework and just have a set of SQL
We have a set of services in .NET 3.5\C# and WCF. The NUnit tests
I have a problem with mysql connection. I have a php script which upload
I have this SQL change script that runs as part of my nant orchestrated
I'm trying to create a SSMS add-in. One of the things I want to
I found this script on about.com which I'm trying to learn from on how
I am working in Postgres and I need to send in a full result
For my application I have to support update scenarios and the database might be
I created some tables using MySQL Workbench, and then did forward ‘forward engineer’ to

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.