I'm confused about the value returned by the SqlCommand ExecuteNonQuery method. I'm doing something like this:
string sSql = "CREATE TABLE #TMP_X (COLA nvarchar(255), COLB nvarchar(max))";
SqlCommand cmd = new SqlCommand(sSql, SqlConn);
int iRowCt = cmd.ExecuteNonQuery();
The value of iRowCt is -1, but the table is created and records can be inserted to it. If I execute the same command directly in isql or in a stored proc, @@ROWCOUNT = 0. What exactly is ExecuteNonQuery returning, and is the -1 return value that I'm getting indicative of any problem?