R
rooster575
Im running a querystring in vb.net and it seems as though SQL server decides
on the order in which to run the 3 queries in the string.. Is this possible?
I would think that SQL server starts with the 1st query, executes it, then
goes to the next.
For example:
************************************************************
Dim myQueryString as string = _
"INSERT INTO ArchivedClients(ClientNo,ClientName) " & _
"SELECT ClientNo,ClientName FROM Clients WHERE State='PA';" & _
"DELETE FROM Clients WHERE State='PA';" & _
"UPDATE someTable SET someField='thisstring';"
Dim SqlCommand As New SqlCommand(myQueryString, SqlConnection)
SqlCommand.ExecuteNonQuery()
************************************************************
Within the above there are 3 separate SQL queries.
Will SQL Server run them in 1-2-3 order, or is
it possible that it will switch the routine.
Thanks for any help.
on the order in which to run the 3 queries in the string.. Is this possible?
I would think that SQL server starts with the 1st query, executes it, then
goes to the next.
For example:
************************************************************
Dim myQueryString as string = _
"INSERT INTO ArchivedClients(ClientNo,ClientName) " & _
"SELECT ClientNo,ClientName FROM Clients WHERE State='PA';" & _
"DELETE FROM Clients WHERE State='PA';" & _
"UPDATE someTable SET someField='thisstring';"
Dim SqlCommand As New SqlCommand(myQueryString, SqlConnection)
SqlCommand.ExecuteNonQuery()
************************************************************
Within the above there are 3 separate SQL queries.
Will SQL Server run them in 1-2-3 order, or is
it possible that it will switch the routine.
Thanks for any help.