Groups | Blog | Home
all groups > sql server programming > october 2006 >

sql server programming : Problems copying live DB for testing


NathanG
10/19/2006 11:23:02 PM
Hi,

I am using server 2005. I copied our live DB to create one for testing only.
I renamed the db with 'test' on the end of the filename. Now the test db
isn't working and gets no results from any queries. The queries are
retrieving data, performing a calculation and output the results. The stored
procedures and functions have not inherited the new db name i.e
live_test.storedprocedure and still have live.storedprecedure. The functions
are the same.

My colleague created a new stored procedure and the naming conventions
changed to the apparent owner of the db. i.e [name].storedprocedure. She did
this by changing the ALTER procedure to CREATE procedure once and changing it
back to ALTER.

Any ideas? All that is needed is an complete replica of the current db and
it seems the replica is trying to point to the orginal.

I am not an expert developer as yet so any suggestions appreciated. If you
need more info please say and I will do my best to provide it.

Thanks,

Alexander Korol
10/19/2006 11:58:02 PM
How did you copy the database? Use backup/restore with new name and
everything should be ok.
Best regards.

[quoted text, click to view]
NathanG
10/20/2006 12:07:01 AM
Did that mate. When we selected the destination we added 'test' on the end.
When do we change the db file name? What about the log and mdf files? Does it
matter where the new db is stored i.e C:/customers instead of where sql
server stores them by default?

Thanks

[quoted text, click to view]
Alexander Korol
10/20/2006 12:25:01 AM
Hi

No. Actual place of data and log files should not matter. It sounds a bit
strange for me that procedures have not changed their names. They actually
should not! Moreover prefix before procedure name is not a database name -
its a schema name.
So could you please describe how you run the queries(sps) and what do you
get as a result? Any security warnings? Are you using Management Studio to
run the queries? Has the new test database appeared in the list of databases?
Is it operational?

[quoted text, click to view]


[quoted text, click to view]
AddThis Social Bookmark Button