Entering ' 2005-01-01 00:00:00 ' in the datetime parameter when debugging a stored procedure produces [MICROSOFT][ODBC SQL Server Driver] Invalid character value error for styling description
Querying SQL Help Documents
The ODBC API defines an escape sequence to represent date and time values, which ODBC calls timestamp data. The OLE DB language definition (DBGUID-SQL) supported by the Microsoft OLE DB Provider for SQL Server also supports this ODBC timestamp format. Applications that use ADO, OLE DB, and an ODBC-based API can use this ODBC timestamp format to represent dates and times.
The escape sequence format for the ODBC timestamp is:
{ literal_type 'constant_value' }
Literal_type
Specifies the type of the escape sequence. The timestamp has three literal_type characters:
d = Date only
t = only time
ts = timestamp (time + date)
' Constant_value '
Is the value of the escape sequence. Each literal_type of the Constant_value must follow these formats.
{ ts ' 1998-05-02 01:23:56.123 '}
{ d ' 1990-10-02 '}
{t '13:33:41'}