Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Type DATE is not a defined system type."

My website working perfect on local, but not in host. I wrote my queries with MSSQL 2008 on local , but our hosting company using 2005
Any solutions?
EDIT : Using DateTime instead of Date looking like solution thanks. If anyone meets a problem like this i solved my problem with using this query instead of DATE type.

CONVERT(VARCHAR, GETDATE(),104) Output -> 15.03.2011 
like image 225
timu Avatar asked Mar 15 '11 14:03

timu


People also ask

Is date a type in SQL?

SQL Date Data TypesMySQL comes with the following data types for storing a date or a date/time value in the database: DATE - format YYYY-MM-DD. DATETIME - format: YYYY-MM-DD HH:MI:SS. TIMESTAMP - format: YYYY-MM-DD HH:MI:SS.

What is system date in SQL Server?

SYSDATETIME is a nondeterministic function. Views and expressions that reference this function in a column cannot be indexed. SQL Server obtains the date and time values by using the GetSystemTimeAsFileTime() Windows API.

What is DateTime2?

The DateTime2 is an SQL Server data type, that stores both date & time together. The time is based on the 24 hours clock. The DateTime2 stores the fractional seconds Up to 7 decimal places (1⁄10000000 of a second). The Precision is optional and you can specify it while defining the DateTime2 column.


2 Answers

As Date columns aren't available in Sql Server 2005 so you have two choices:

1) Ask your hosting company to use Sql Server 2008 (or choose another host which does)

2) Use DateTime columns instead of Date

like image 106
stuartd Avatar answered Sep 20 '22 16:09

stuartd


DATE is a new datatype introduced in 2008. It is not available in 2005.

like image 27
Joe Stefanelli Avatar answered Sep 17 '22 16:09

Joe Stefanelli