Firstly I'm a complete newbie when it comes to mssql. I have five MSSQL databases, In all of them except one I can easily do say...
SELECT TOP 10 * FROM dt_Organizers
However one of the new databases require me to do this:
SELECT TOP 10 * FROM dbuser.dt_Organizers
Note that all the tables in all databases have "dbuser" "dbamy" "dbyon" "dbmio" "dbcana" prefixes respectively, this never caused a problem before. Now if I use the query without doing dbuser.dt_Organizers it brings up:
Warning: mssql_query() [function.mssql-query]: message: Invalid object name 'dt_Organizers'.
are you using the USE command anywhere?
Not at all. I'm using mssql_query function in php... does that help? ^^'
the USE command is intended to select the database for the commands which follow
if you can't get FROM dt_Organizers to work, you're probably not in the dbuser database, which is why you have to say FROM dbuser.dt_Organizers
What I think is going on is the users who create the tables are making them in their own schema, so, if you are logged in as dbuser and you do SELECT * FROM dt_Organizers you are really doing SELECT * FROM dbuser.dt_Organizers. Check out the default schema property for the users -- should tell you alot.