sql server - Execute SELECT using SQLExecDirect -


I have the MSSQL database service in which the database created with ggg table t1

is trying to execute SELECT statement

  RetCode = SQLExecDirect (hStmt, wszInput, SQL_NTS);   

is the content of wszInput

Content has an error: >

  [42 s 02] [Microsoft] [SQL Server Native Client 11.0] [SQL Server] Invalid Object Name 'Jug. 1 '(208) SQL COMMAND & gt; Db.jig Choose from 1 *  

Where's the problem?

You can use the database, schema , and then the table for this particular syntax Need to isolate. Your code should be (assuming that the default schema of T1 dbo is

SELECT * FROM ggg.dbo.t1 < / Code>

If you type y , SQL assumes that you currently talk about tables or views in the default (usually DBO) schema of the connected database are doing.

If you type xy , SQL assumes that you are currently y in the y schema of the associated databases. Talking about the table.

If you type x.dbo.y , the x database in the dbo schema for a table named SQL y will appear in


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -