最简单的一个问题 不行,SQL没有提供只有日期的类型也没有只有时间的类型,只有日期加时间的类型:datetime 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以都设为字符类型try:select convert(varchar(10),getdate(),120)select convert(varchar(8),getdate(),108) 没有这样的类型,但可以转换查:sql online help: convert 你可以先存在一个字段中,然后,通过改表将其分为两个字段测试如下:--声明表变量:declare @a table (日期 datatime,时间 datetime)--建触发器create trigger ins_time on @a for insert, updateasdeclare @ins_time datetime select @ins_time =日期update @a set 日期=left(@ins_time ,10)update @aset 时间=right(@ins_time,9)) --针对你的时间格式 有所改动go 各位我还有一个很类似的问题,能不能帮看一下http://expert.csdn.net/Expert/topic/2098/2098849.xml?temp=.2348596 刚才那个格式比较乱,重发。(建表和初始化数据的sql已经在帖子里了) 排行榜SQL语句 关于一个取值排序的问题, 请指教! 日期计算问题 这个错误怎么解决? 关于在windows2003企业版下安装sqlserver2005的问题,大家进来看看 通配符是什么? 这样的SQL语句怎么写? 给我推荐一个免费的数据库系统软件 用BDE连Ms SQL SERVER是不是要装补丁,何处有? 我想学SQL编程。。。请高手指路。。。 怎样复制表,解决给分
try:select convert(varchar(10),getdate(),120)select convert(varchar(8),getdate(),108)
查:sql online help: convert
测试如下:
--声明表变量:
declare @a table (日期 datatime,时间 datetime)
--建触发器
create trigger ins_time on @a for insert, update
as
declare @ins_time datetime
select @ins_time =日期
update @a
set 日期=left(@ins_time ,10)
update @a
set 时间=right(@ins_time,9)) --针对你的时间格式 有所改动
go
http://expert.csdn.net/Expert/topic/2098/2098849.xml?temp=.2348596