Sql server 2005 日期数据类型 [英] Sql server 2005 Datatype for Date

查看:40
本文介绍了Sql server 2005 日期数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个带有 DATE 列的表.对于该列,我使用 DateTime 数据类型.

I want to create a table with DATE Column. For that column I am using DateTime datatype .

是否有任何其他数据类型或选项可以只显示日期而不显示时间.我使用的是 SQL Server 2005

Is there any other datatype or option to display only date without Time. am using Sql Server 2005

有什么格式可以使用吗?

Have any format to use?

否则,如果我使用 Datetime 数据类型,我如何使用 Update 查询在 c# 中检索.

Otherwise if i use Datetime datatype, how can I retrieve in c# with Update query.

我使用 C# 代码如何只检索日期

I use C# code how to retrieve only date

SqlCommand cmd = new SqlCommand(("Update tablename set Date = convert(GETDATE(),103) where Name ='" + TextBox1.Text + "' "), con);

推荐答案

你必须使用 Datetime.看看这个图表.

这篇关于Sql server 2005 日期数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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