日常问题总结(7)

xiaoxiao2021-02-28  101

如何在SQL 的字符串内使用单引号

select * from table where id='''incall'''   在sqlserver中,用2个'表示输入一个'

sql 存储过程里的if else while 一:if  else 

   语法: if 条件 begin 执行的操作 end else begin 执行的操作 end

eg: if @flag=1

二:while   语法:while 条件 begin 执行操作 end

sqlserver中的isnull函数

微软的 ISNULL() 函数用于规定如何处理 NULL 值。 NVL(), IFNULL() 和 COALESCE() 函数也可以达到相同的结果。

eg:存储过程中 if ISNULL(@sys_Where,'')=''

SQL Server 2008下轻松调试T-SQL语句和存储过程

点击F11逐语句debug 或者F10逐过程调试代码

详细可以参考http://blog.csdn.net/dinglang_2009/article/details/6887413

转载请注明原文地址: https://www.6miu.com/read-79653.html

最新回复(0)