TSQL 合并日期字段和时间字段 [英] TSQL to combine a date field and a time field

查看:43
本文介绍了TSQL 合并日期字段和时间字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 logparser 将 IIS 日志导入数据库会导致一列包含日期值和第二个时间字段:

Using logparser to import IIS logs to a db results in one column that has the date value and a second field for time:

2010-05-25 00:00:00.000

2010-01-01 11:11:58.000

我想编写一个 after insert 触发器,它结合了 2 个字段.

I'd like to code an after insert trigger that combines the 2 fields.

推荐答案

如果其他人偶然发现了这个线程(或者如果原发帖者仍然可以使用这个答案),请查看中的 TO_TIMESTAMP ( date , time ) 函数LogParser 可让您将仅日期时间戳与仅时间时间戳组合成一个完整的时间戳值……并使您不必在数据库中进行转换……

In case somebody else stumbles on this thread (or in case the original poster still can use this answer), look into the TO_TIMESTAMP ( date , time ) function in LogParser which lets you combine a date-only timestamp with a time-only timestamp into a full timestamp value... and saves you from having to convert in the db...

这篇关于TSQL 合并日期字段和时间字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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