CREATE TABLE a
(id INT , NAME VARCHAR(8000))
INSERT INTO a VALUES (1,'''/*
declare @p2 int
set @p2=5713
exec GetICMaxNum 'ICSTOCKBill',@p2 output
select @p2
*/
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
''')
提示错误消息 102,级别 15,状态 1,第 5 行
'ICSTOCKBill' 附近有语法错误。
请大家给修正意见,谢谢!!
------解决方案--------------------
- SQL code
CREATE TABLE a ( id INT , NAME VARCHAR(8000) )INSERT INTO aVALUES ( 1, '/*declare @p2 intset @p2=5713exec GetICMaxNum ''''ICSTOCKBill'''',@p2 outputselect @p2*/set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo' )
------解决方案--------------------
- SQL code
--不理解你把脚本插入到数据库中做什么?CREATE TABLE a ( id INT , NAME VARCHAR(8000) )INSERT INTO aVALUES ( 1, '/*declare @p2 intset @p2=5713exec GetICMaxNum ''''ICSTOCKBill'''',@p2 outputselect @p2*/set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo' )SELECT * FROM a/*id NAME----------- -----------------------------1 /*declare @p2 intset @p2=5713exec GetICMaxNum ''ICSTOCKBill'',@p2 outputselect @p2*/set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo(1 row(s) affected)*/