Friday, March 23, 2012

Generating SQL-Skripts

Hi,
i'm sitting in front of an obscure database containing round about 400
views. :-)
I would like to export these views into an working SQL-Skript to be able
to recreate these views on a second database with an identical
table-structure.
The problem: The views are dumped to the file in the wrong order. Do you
know
this problem? What can I do?
Thanks for any hints...
Jan
Hi,
Are you going to replicate the Table and View into the new database or just
the views.
1.
If you are going to create only the views in the new database then you have
to change the script for view creation. Because your real table will
be in the old database.
it should be some thing like
Create view V1_customer as select * from olddbname..table_name
2.
Incase if you are moving both Table and the view, then create 2 scripts. 1
for tables and the other for views.
Execute the Tables first after then run the script contains the view.
Did I answered your question completely?
Thanks
Hari
MCDBA
"Jan Schmitz" <schmitz@.face.de> wrote in message
news:Oz4KJGLGEHA.712@.tk2msftngp13.phx.gbl...
> Hi,
> i'm sitting in front of an obscure database containing round about 400
> views. :-)
> I would like to export these views into an working SQL-Skript to be able
> to recreate these views on a second database with an identical
> table-structure.
> The problem: The views are dumped to the file in the wrong order. Do you
> know
> this problem? What can I do?
> Thanks for any hints...
> Jan
>
|||check out www.dbghost.com
|||"Hari Prasad" <hari_prasad_k@.hotmail.com> schrieb im Newsbeitrag
news:%23W$dU5LGEHA.3940@.tk2msftngp13.phx.gbl...
> Hi,
> Incase if you are moving both Table and the view, then create 2 scripts. 1
> for tables and the other for views.
> Execute the Tables first after then run the script contains the view.
>
Hi,
this is what i tried. The problem ist, that the 400 Views in the
Views-Skript are dumped in the wrong order. View "B", selecting from View
"A" is created before View "A" ist created. So the generated skript simply
doesn't work. I think, what I need is a way to renew the sysdepends...
Greetings...Jan
|||"mark baekdal" <anonymous@.discussions.microsoft.com> schrieb im Newsbeitrag
news:BED6BA68-89A6-42AC-A075-FF67F35D86A5@.microsoft.com...
> check out www.dbghost.com
Hi,
at first look, this sounds great - I will take a closer look at that tool...
Thanks a lot,
Jan
sql

No comments:

Post a Comment