sql - Keyword GO throws errors with PHP -
i've come across problem trying restore mssql dumps in php on linux server. i'm reading in file , passing file in query.
this works:
create table [dbo].[recipes]( [id] [int] identity(1,1) not null, [title] [nvarchar](500) collate sql_latin1_general_cp1_ci_as null, [desc] [text] collate sql_latin1_general_cp1_ci_as null, [directions] [text] collate sql_latin1_general_cp1_ci_as null, [compauthor] [nvarchar](500) collate sql_latin1_general_cp1_ci_as null, [compname] [nvarchar](500) collate sql_latin1_general_cp1_ci_as null, [servings] [nvarchar](50) collate sql_latin1_general_cp1_ci_as null, constraint [pk_recipes] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) )
but add n word go
with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) ) go
it throws error
warning: mssql_query(): message: incorrect syntax near 'go'
my question causes error , how fixed?
go
not transact-sql keyword. batch separator tools management studio , sqlcmd.
the answer not inject go
commands batches sending application. send them separate batches (if necessary).
source: go (transact-sql)
Comments
Post a Comment