dbMDFName = C:\main\ext\AssetTrackingExt.mdf;
dbLDFName = C:\main\ext\AssetTrackingExt.ldf;
string str = "use master \n GO \n sp_attach_db 'ATT'" + "," + "'" + dbMDFName + "'" + "," + "'" + dbLDFName + "'";
this is my backup database code but an error occur
"Incorrect sysnat near Go"
what is solution for this error
SQL Backup error in c sharp
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jul 25, 2011, 11:16 PM EDT
Try like this,
string str = "use master \n GO \n sp_attach_db N'ATT'" + "," + " N' " + dbMDFName + "'" + "," + " N' " + dbLDFName + "'";
Suthish NairRank #92 · 22.8K reputationPosted Jul 26, 2011, 12:14 AM EDT
jayakrishnan Morayur156 reputationPosted Jul 26, 2011, 3:04 AM EDT