Input fault resolution method of datetime parameter during stored procedure debugging

Source: Internet
Author: User
Tags datetime odbc sql server driver odbc sql server driver ole

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'}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.