|
Home > Archive > Microsoft SQL Server forum > April 2005 > Refresh data from production to development
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Refresh data from production to development
|
|
|
| Hi all, I've been assigned a task of refreshing data from the
production env to development env.
what i got is a backup file of a db in the prod env, i now need to
make that into the development env.
I can restore it to the dev env no problem, but the warnings i got are
that the tables owner in prod and dev env need to be different, that
is, owner is A in prod env and owner is B in dev env.
So I need to:
1) restore the db in dev env
2) change table owner from A to B
3) change related triggers
4) change related views
Can anyone suggest me an approach that is most efficient?
Thanks a lot.
| |
|
| Hiya Bosco,
I'd create a script that dynamically builds a " sp_changeobjectowner
"
statement for all objects that user A owns.. It'll simlify the steps
to this
1. Restore db in dev
2. Create and run permissions script
Syntax is as follows:
EXEC sp_changeobjectowner
'<table_name>', 'B'
| |
|
|
|
|
|