Guys please help I'm losing it. I'm trying to copy or backup my existing db table at button click using an sql query in visual studio 2010 C#. I keep getting the same error and batle to figure out what the fault could be.
#######I first tried....
string sqldatex = "Select * Into NewTable From OldTable";
SqlCommand comdatex = new SqlCommand(sqldatex, conn);
comdatex.ExecuteScalar();
Error: Incorrect syntax near 'NewTable'.
###########And then I tried...
string sqldatex = "INSERT INTO NewTable (SLA) SELECT SLA FROM OldTable";
SqlCommand comdatex = new SqlCommand(sqldatex, conn);
comdatex.ExecuteScalar();
Error: Incorrect syntax near 'NewTable'.
Please help me
#######I first tried....
string sqldatex = "Select * Into NewTable From OldTable";
SqlCommand comdatex = new SqlCommand(sqldatex, conn);
comdatex.ExecuteScalar();
Error: Incorrect syntax near 'NewTable'.
###########And then I tried...
string sqldatex = "INSERT INTO NewTable (SLA) SELECT SLA FROM OldTable";
SqlCommand comdatex = new SqlCommand(sqldatex, conn);
comdatex.ExecuteScalar();
Error: Incorrect syntax near 'NewTable'.
Please help me