TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mike
NA
25
0
Query success in MMS, failure in code
Mar 1 2010 6:21 AM
Hey,
I have two databases and i use schema compare in Visual Studio 2008 to generate a script to upgrade one to the other. Now i have written some code which needs to execute this script on a database. If i create the script, and then open up Management Studio and paste it in and run it, the query executes successfully. However, if i let my code do it an error is returned;
"Incorrect syntax near the keyword Go", "Incorrect syntax near the keyword SET" etc.
Does anyone know why these two methods of running the same script produce different results? Once i've connected to the server and started the transaction i simply use; (any pointers on this would be great!!)
SqlCommand
command =
new
SqlCommand
(script, conn, tn);
command.ExecuteNonQuery();
Reply
Answers (
1
)
Hey i want some sql queries with their optimized queries
Table Query