Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 06, 2012 03:39 AM by naveenchandrabhatt
Mar 06, 2012 02:35 AM|LINK
I have a source code for my project which has lot of sql statement included in the sripts.But I am facing a problem with the ode as it throws an error as invalid object name whenever there is a sql transaction. I have found the reason as ..all sql
staments in the code are mentioned as selct * from tablename ...but the sql is considering it as invalid object name. if I change this value to select * from cp.tablename , it is working fine.
is it mandatory to give schema names also in sql statements? if it is mandatory then I have to make changes to lot of code...do we have any option where database considers schema name by default when we are running the statements with
simpple table name?. Please help e out
Mar 06, 2012 02:56 AM|LINK
if you are executing the sql statements in the sql server then no need to give the schema name.
it will directly will accept the select* from table name, where as if you are trying from outsite like using a connection with the sql server and then writing the sql statement in an application in that case yes you need to give the schema name also
Mar 06, 2012 03:23 AM|LINK
hey I am getting same error in database also. if I dont give schema name it is not working.
I am using SQL Server 2008 R2.
Mar 06, 2012 03:39 AM|LINK
see from the left side click on your data base name and then in the upper side there is one option new query and click on that than a new window will open and write the sql statement as
select* from your table name and then press f5
once you are done with that let me know the status