文章分类 -  sqlserver

摘要:存储过程中: exec pro 这种语法执行存储过程 exec(@xxx) 这种执行一条普通sql语句 如果要返回值,需要声明 @tpl varchar(100) OUTPUT 这样一个入参 比如执行查询 set @sql = N'SELECT * from '+@tablename exec(@s 阅读全文
posted @ 2022-06-03 09:55 叨叨的蜗牛 阅读(1128) 评论(0) 推荐(0) 编辑
摘要:先记录一下,laravel,php8.0在linux 链接sqlserver问题: 最麻烦得问题就是报错: SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver for SQL Server to communicate 阅读全文
posted @ 2022-05-13 10:31 叨叨的蜗牛 阅读(523) 评论(0) 推荐(0) 编辑
摘要:select t1.c1, t2.c2, cast(cast(t2.c2 - t1.c1 as decimal(10, 2)) / cast(t2.c2 as int) as decimal(10, 2)) from (select count(*) realCount from t1) t1, ( 阅读全文
posted @ 2022-02-18 11:25 叨叨的蜗牛 阅读(127) 评论(0) 推荐(0) 编辑
摘要:dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值 例如:向日期加上2天 select dateadd(day,2,'2004-10-15') --返回:2004-10-17 00:00:00.000 如果加0天,就是当前字符串要转成的日期格式(yyyymmdd) se 阅读全文
posted @ 2022-02-10 10:11 叨叨的蜗牛 阅读(3167) 评论(0) 推荐(0) 编辑
摘要:##查看存储过程: CREATE PROCEDURE [dbo].[updatenoViolationDays] AS BEGIN DECLARE @line NVARCHAR(50) DECLARE @rq NVARCHAR(50) DECLARE @noViolationDays NVARCHA 阅读全文
posted @ 2022-01-11 13:36 叨叨的蜗牛 阅读(271) 评论(0) 推荐(0) 编辑
摘要:GetDate select DateName(year,GetDate()) as '年'; select GETDATE() as '当前日期',DateName(year,GetDate()) as '年',DateName(month,GetDate()) as '月',DateName(d 阅读全文
posted @ 2021-12-27 16:19 叨叨的蜗牛 阅读(595) 评论(0) 推荐(0) 编辑