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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhimanyu K VatsaPosted Sep 11, 2012, 10:52 AM
Vikas AhlawatPosted Sep 11, 2012, 12:53 PM
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
namspaces..
Anyway thanx to Abhimanyu and Vikrant
for your replies.......
Vikas AhlawatPosted Sep 11, 2012, 3:51 AM
Vikas AhlawatPosted Sep 11, 2012, 3:39 AM
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 ...
Vikrant MorePosted Sep 11, 2012, 3:11 AM