阿拉伯语日期存储到SQL Server 2008? [英] Arabic Date Store to SQL Server 2008?
本文介绍了阿拉伯语日期存储到SQL Server 2008?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个C#小应用程序,用于从Excel中读取数据,然后将数据存储到Sql Server2008.在Excel中,有一个Hijri_Date列,如dd/MM/yyyy格式,
范例:17/4/1432
我需要阅读Excel并将其更新到SQl Server2008.为此,在sql server中,必须为此声明什么数据类型? DateTime或datetime2吗?
而更新语句将是什么?
I have a small application in C# for data''s read from Excel and then store the datas to Sql Server 2008. In Excel there is a column for Hijri_Date like dd/MM/yyyy format,
Example: 17/4/1432
I need to read from Excel and update it to SQl Server 2008. For that in sql server what datatype has to declare for this? either DateTime or datetime2 ?
And what will be the update statement?
Update MyTable set My_Hijri_Dt=?? where MyField1='MyValue';
有人可以提供详细信息吗?
谢谢BY
PARAMU
Does anybody can give the details?
Thanks BY
PARAMU
推荐答案
我对此不是100%肯定,但根据 ^ ] SQL Server仅支持Greogrian日期.这是有道理的,因为希勒(al-Hijri)是为数不多的不跟太阳年有关的日历之一,也不是应用月球观测的困难.您可以使用 cast/convert 将UTC日期更改为回历. a> [ ^ ]函数,但是最好将所有操作存储在UTC的SQL服务器端,并编写一个函数以在客户端上转换为al-Hijri.
I''m not 100% certain about this, but according to this[^] SQL server only supports Greogrian Dates. This makes some sense as al-Hijri is one of the few calendars that doesn''t follow the solar year and the difficulty where lunar observations are applied. You can change a UTC date to a Hijri on using the cast/convert[^] functions if you want, but it''s probably better to store do everything on the SQL server side in UTC, and write a function to convert to al-Hijri on the client.
这篇关于阿拉伯语日期存储到SQL Server 2008?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文