How to I pass this to SQL Server, it seems to want the "Go 4" on a second line?
Insert Into tbl Values (896,0) GO 6
How to I pass this to SQL Server, it seems to want the "Go 4" on a second line?
Insert Into tbl Values (896,0) GO 6
Your question is a little confusing from where I stand, but if you're trying to insert more than one record, I use something like this at work in MS SQL Server 2K all the time:
INSERT INTO table (field1, field2)
SELECT 'Value1', 'Value2'
UNION SELECT 'Value3', 'Value4'
Are you sure you want to do this? The documentation says:
GO is not a Transact-SQL statement; it is a command recognized by the sqlcmd and osql utilities and SQL Server Management Studio Code editor. [...] Applications based on the ODBC or OLE DB APIs receive a syntax error if they try to execute a GO command.
If you are still sure you need this, use the vbCrLf
constant to insert a linebreak:
Dim sql As String = "Insert Into tbl Values (896,0)" & vbCrLf & "GO 6"