Incorrect syntax near the keyword''

Source: Internet
Author: User
Tags management studio microsoft sql server management studio sql server management sql server management studio

I am using hresult
Recordset15: open (const _ variant_t
& Amp; source,...) function where

Source ="
Roworder as (select [Chart number] from [DBO]. [Patient]) Select * From roworder "in C ++ module on SQL 2005 version 2005.90.3233.0. The msado15.dll version is
2.81.1132.0.

 

It
Returns db_e_errorsincommand-"incorrect syntax near the keyword ''".

 

Error numbers: 0x80040e14, 0x00000c14

Short error:

Incorrect syntax near the keyword''

Error:

Source: Microsoft ole db provider for SQL Server

Description: incorrect syntax near the keyword 'with'

Error message: idispathch Error #3092

 

This query works fine on Microsoft SQL Server Management studio Express version
9.00.3042.00.

 

Standard query like "select * from [DBO]. [Patient]" works without problem.

Any suggestions?

-------------------------------------------------------------

Try
Adding a semi colon; before your with statement

-------------------------------------------------------------

Unbelievable, but it works after.

Thank you.


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.