set @InsertStr='INSERT INTO [dbo].[T_SchoolPercentMonth]([SchoolID],[MonthOfYear],[PercentNum]) VALUES('''+cast(@SchoolID as nvarchar)+''','''+convert(char(7),getdate(),20) +''','+cast(@PercentNum as nvarchar)+')'; 引用字符 加一对单引号. 'select * from tb wher
平时update的时候直接更改字段内的值,例如: update table_temp set name = 'Hider' where id = 100; 但更新后的值中包括单引号,则不能按以上方式进行更新,会报错. 遂测试之. -- 建立测试表 create table temp_cwh_test_1219 ( id varchar2(10), name varchar2(20) ); -- 插入数据 insert into temp_cwh_test_1219 values (1,'Nick
注意:存储过程中单引号 ,四个单引号 SET @sql = CONCAT('select user_id into ',m_user_id,' from go_user where mobile =','''',p_user_name,'''',' AND password=','''',p_password,'''');