日期数据类型在SQL Server 2008 DataCenter Server R2上不起作用 [英] Date datatype does not work on SQL Server 2008 DataCenter Server R2

查看:102
本文介绍了日期数据类型在SQL Server 2008 DataCenter Server R2上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用SQL Server 2008 DataCenter Server R2创建表时,无法为数据列使用SQL日期"数据类型,但是执行查询时出现错误,指出日期格式不可用数据类型.它也没有出现在桌子设计上.但是当我参考一些书时,我发现SQL Server 2008中有一种新的数据类型.

我不知道该怎么解决!请善待解决!

When I am trying to create a table using SQL Server 2008 DataCenter Server R2 I cannot use the SQL ''Date'' datatype for a Data Column but the query was executed with an error that giving the date format is not a available data type. It also not appeared at the table design. But when I refer some books I found that there is a new data type in SQL Server 2008.

I don''t know how to solve this matter! Please be kind to solve this!

推荐答案

我不知道您的意思,而是使用
I have no idea what you mean, but instead of Date use DateTime[^] data column, for example:
CREATE TABLE Table1 ([Date] DATETIME)
INSERT INTO Table1 ([Date]) VALUES('2012-05-23')
SELECT [Date] FROM Table1



一些有用的链接:
T-SQL数据类型 [创建表 [更改表 [



Some useful links:
T-SQL data types[^]
CREATE TABLE[^]
ALTER TABLE[^]


这篇关于日期数据类型在SQL Server 2008 DataCenter Server R2上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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