running multiple scripts

G

G. Dean Blake

I have to develop a program to convert a database to a new version. This
entails reading old tables, masaging the data, deleting old tables and their
relationships, adding new tables with new relationships, ets.

More than just executing sql with dataadapters, it seems I also need to
execute multiple scripts with multiple steps.

What is the best approach to take with this kind of program?

Thanks,
G
 
W

William Ryan eMVP

I'd look to a tool like DTS if at all possible. Otherwise you can build your
scripts - I have an example of doing this here
http://www.knowdotnet.com/articles/ddl.html - probably want to run it within
the context of a transaction if possible - but that depends on your overall
goal. DTS does make for a Nice solution though!

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
G

G. Dean Blake

William,
I read your article and it addresses exactly what I want to do. But, is
there a way to find out if the script executed without error?
sorry - not much experience with T-SQL
TIA,
G
 
W

William Ryan eMVP

There are actually two ways depending on what type of error you are talking
about. the first way is to wrap each execute in a try/catch (or just one
but that would bring with it some other problems) and just trap the
exception. The other approach is to use Print or RaiseError messages within
your Proc and trap the InfoMessage event
http://www.knowdotnet.com/articles/connections.html

HTH,

Bill

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top