SQL2008 存储过程参数相关

 

使用inputparame时,使用的是 varchar(20),和数据库中的DEPARTNAME完全匹配,可以查出值:

 USE [test]
GO SET ANSI_NULLS OFF
GO SET QUOTED_IDENTIFIER OFF
GO ALTER PROCEDURE [dbo].[pro_testprocedure](@inputparame varchar(20)) AS BEGIN
SELECT DEPARTNAME, charindex( @inputparame, DEPARTNAME) as indexNo
from his_depart
END
GO

Code1

而使用inputparame时,使用的是 varchar时,却没用能够用过varindex得到值:

 USE [test]
GO SET ANSI_NULLS OFF
GO SET QUOTED_IDENTIFIER OFF
GO ALTER PROCEDURE [dbo].[pro_testprocedure](@inputparame varchar) AS BEGIN
SELECT DEPARTNAME, charindex( @inputparame, DEPARTNAME) as indexNo
from his_depart
END
GO

Code2

新手向 =。。=

上一篇:虚拟机安装ubuntu18.04及其srs服务器的搭建


下一篇:Windows编程中UNICODE和_UNICODE定义问题