Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Will you help me how to get data from schema based table

i have a table with the schema [report]

i trying to call table using openrowset like

SQL
SELECT *
FROM OPENROWSET('SQLNCLI', 'Data Source=test;Trusted_Connection=yes;Initial Catalog=PROD;Integrated Security=false;user id=sa; password=intellution;',
     'SELECT *  from [PROD].[report].[employee] ')


i am getting error
CSS
Msg 11529, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
The metadata could not be determined because every code path results in an error; see previous errors for some of these.
Msg 208, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1
Invalid object name '[PROD].[report].[employee];


can you help me how to get data from above query
Posted
Updated 26-Jan-15 20:28pm
v3
Comments
Kornfeld Eliyahu Peter 27-Jan-15 4:11am    
It seems that there is no such object [PROD].[report].[employee] in your data source 'test' - check it...
(You maybe missing the schema part here)
Member 9714428 27-Jan-15 4:32am    
i connect ed to test data source using ssms.while using openrowset i am getting error.can you please tel me what type of need to put there?
Kornfeld Eliyahu Peter 27-Jan-15 4:38am    
I do not know how your db build so can't tell you exactly what the problem is (it is about the names however)...
Please read here, to see how SQL object names are built. That may help you understand where your error is...
https://technet.microsoft.com/en-us/library/ms187879(v=sql.105).aspx
Member 9714428 27-Jan-15 8:16am    
i am not able to connect test data source.
Kornfeld Eliyahu Peter 27-Jan-15 8:19am    
And? What error do you get?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900