惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
Jina AI
Jina AI
H
Help Net Security
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
L
LangChain Blog
Recorded Future
Recorded Future
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
GbyAI
GbyAI
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
M
MIT News - Artificial intelligence
爱范儿
爱范儿
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
B
Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
MongoDB | Blog
MongoDB | Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
The Cloudflare Blog
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
D
DataBreaches.Net
博客园 - 【当耐特】
T
Troy Hunt's Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog

博客园 - Ticky

关于WCF的“调用方未由服务进行身份验证”的另一解决方法 Process.Start触发Enviroment的改变 [转]ASP.NET页面事件:顺序与回传详解 [转]Dynamic ListView LayoutTemplate [转]多层C/S系统及其在PB中的应用 .NET强命名设置随笔 - Ticky - 博客园 [转载]SQL Server阻塞详解 Chrome发布了,感受新体验 绝对经典的十个故事 SQL SERVER的一些常用查询语句收集 链接服务器的服务器连接问题 别把捐款与善心划等号 [转]ORM的介绍 工作随记 [转]Windows Communication Foundation介绍(四) [转]Windows Communication Foundation介绍(三) [转]Windows Communication Foundation介绍(二) [转]Windows Communication Foundation介绍(一) Microsoft OneNote 2007的体验
存储过程参数的时间默认值解决方法
Ticky · 2008-05-27 · via 博客园 - Ticky

存储过程参数的时间默认值解决方法

Posted on 2008-05-27 14:28  Ticky  阅读(2927)  评论(2)    收藏  举报

在数据库中创建存储过程的时候,参数的默认值是必须为常量或NULL的,因此对于希望将时间类型参数的默认值设为当前时间的朋友来说,就会出现操作不当的情况了。
解决方法很简单,只需将其默认值设置延后就可以了。
如:
CREATE PROCEDURE TEST
    @TestDate DATETIME=NULL
AS
    IF(@TestDate IS NULL)
        SET @TestDate=GETDATE()
    ...
    do something what you want
    ...
GO