需要SQL Server存储过程示例代码,其中接受Datetime作为参数 [英] need SQL Server stored procedure example code which Accept Datetime as parameter

查看:88
本文介绍了需要SQL Server存储过程示例代码,其中接受Datetime作为参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要SQL Server存储过程示例代码,其接受Datetime作为参数

need SQL Server stored procedure example code which Accept Datetime as parameter

推荐答案

请参考以下具有Datetime作为参数的链接。



http://www.wiseowl.co.uk/blog/s263 /parameters.htm [ ^ ]



http://bytes.com/topic/sql-server/answers/633284-default-datetime-argument-stored-procedure [ ^ ]



对于SQL SERVER存储过程的基本知识,请参阅下文。



Sql Server - 如何在SQL Server中编写存储过程 [ ^ ]



https://msdn.microsoft.com/en-us/library/ms345415.aspx [ ^ ]
Please refer the below links which has Datetime as parameter .

http://www.wiseowl.co.uk/blog/s263/parameters.htm[^]

http://bytes.com/topic/sql-server/answers/633284-default-datetime-argument-stored-procedure[^]

For SQL SERVER stored procedure basics refer below .

Sql Server - How To Write a Stored Procedure in SQL Server[^]

https://msdn.microsoft.com/en-us/library/ms345415.aspx[^]


什么是问题?



这样的事情不起作用吗?



And what is the Problem?

Does something like this not work?

CREATE PROCEDURE MYSP(@EXEC_DT DATETIME)
AS
BEGIN
    SET NOCOUNT ON;
....
END


create PROCEDURE [dbo].[uspGetBlah]
{
  @fromDateTime DATETIME,
  @toDateTime DATETIME
}


exec uspGetBlah @fromDateTime='2015-06-01 00:00:00',@toDateTime='2015-06-26 00:00:00'

这篇关于需要SQL Server存储过程示例代码,其中接受Datetime作为参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆