When i enter http://akor.alternatifim.com/
i get the error below
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'tblSARKICIM'.
The SQL statement is so simple like
Select * from tblSARKICIM
However when i change the SQL statement Select * from lyric.tblSARKICIM
lyric is username and owner of the tables.
Problem is solved. I transfer the My SQL Server and then this problem occurs and i don't want change all my SQL statements.
What can i do?Going to need to see the code.|||Can I ask, why does anyone feel the need to create database objects under any owner other than dbo?
I've always seen it cause more trouble than it's worth.
And if you want tables with the same name, why not just create another database?|||I am running that SQL Server with hosting firm, and can not see user of dbo.
What can i do for that? If administrators give Database Creators privilage to user lyric, is the problem solved? Or i need to change the owner of the tables to dbo?
I don't think there is a wrong with the code, because it was running without problem before transfering db.
Thanks for your helps.|||then the only work around is to instruct your web application (as I can see) to connect to the database server with that user (lyric) credentials.
This is the way that SQLServer works: when you specify an incomplete object qulificator (eg. DBname.Owner.ObjectName), then SQL first tries with current db, and current user as a default. Then switch to dbo (in place of owner). If all tose failed, then an exception of "Invalid object name ..." is thrown.
So if all your objects have the lyric user as their owner, you have two options to query them:
First: select * from lyric.tbl1 (works for any authenticate user that has select permissions on that tbl1 table) or,
Second: select * from tbl1 (works only if the current user is lyric)|||then the only work around is to instruct your web application (as I can see) to connect to the database server with that user (lyric) credentials.
This is the way that SQLServer works: when you specify an incomplete object qulificator (eg. DBname.Owner.ObjectName), then SQL first tries with current db, and current user as a default. Then switch to dbo (in place of owner). If all tose failed, then an exception of "Invalid object name ..." is thrown.
So if all your objects have the lyric user as their owner, you have two options to query them:
First: select * from lyric.tbl1 (works for any authenticate user that has select permissions on that tbl1 table) or,
Second: select * from tbl1 (works only if the current user is lyric)
DB owner is lyric and if i perform the query with lyric.name_of_table it runs without any errors. However changing all query user_name.table_name will be very difficult for me.
For that reason, i want to use query like select blah blah from tbl1 not lyric.tbl1
Is there a way to determine and change the current user? Or i need to change the owner of the table. And What will be do if administrator give lyric to Database Creators privilage (Server Role)
Thanks for your help|||I use that command and change the owner of the db lyric to dbo
And it is working now, thanks for your help :)
EXEC sp_changeobjectowner 'lyric.tblSARKICIM', 'dbo'
No comments:
Post a Comment