0

I have an application which is accessing sql objects(stored procs/tables) etc which are defined under a schema 'A' for example A.my_stored_proc.

This application is working fine as intended when I connect it with the test server database. But, now as the client has asked to copy the db to into a local sql server dev edition for further enhancements.

I took backup of the db from the test server and restored it back to dev system. Now when I change the connection string of the application, the application throws an error saying that unable to located 'A.my_stored_proc'

I decided to manually test all the schema, user roles and rights against the test server which I found all are same.

For testing purpose I renamed the stored proc with 'dbo' schema and the application started working.

Can someone help me with this problem of schema with sql server 2008 r2?

Rashwan L
  • 38,237
  • 7
  • 103
  • 107

1 Answers1

0

On the test server, the user account under which you application works probably has A as its default schema, yet the procedure is called without schema name mentioned:

exec my_stored_proc;

On the dev server, your user account may have dbo as its default schema (or it might be the owner of the restored database, which in this particular case will lead to the same behaviour).

Consult with SQL Profiler traces to determine how procedure calls look like, exactly.

Roger Wolf
  • 7,307
  • 2
  • 24
  • 33