I am executing script for create database.
this script is running fine in SSMS..
and when I execute it..
cmd.ExecuteNonQuery();
it gives error
like
incorrect syntax near GO .......
How can is solve it..?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Sep 11, 2012, 6:52 AM EDT
Vikrant MoreRank #1,157 · 1.6K reputationPosted Sep 10, 2012, 11:11 PM EDT
Vikas AhlawatRank #2,648 · 525 reputationPosted Sep 10, 2012, 11:39 PM EDT
I am posting my code and script(not full) here..
I am storing the script in .txt file the script is
I have tried (removed Go) but
problem not solved
here in two procedure i am using @Day variable it showing that u have already declared it...
means it treat whole script as a single query...
so what can i do now..
code for that is ...
Vikas AhlawatRank #2,648 · 525 reputationPosted Sep 10, 2012, 11:51 PM EDT
Vikas AhlawatRank #2,648 · 525 reputationPosted Sep 11, 2012, 8:53 AM EDT
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
namspaces..
Anyway thanx to Abhimanyu and Vikrant
for your replies.......