Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating table structures on distributed Apps
Message
 
 
À
13/01/2012 16:24:45
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
C# 4.0
Divers
Thread ID:
01532901
Message ID:
01532905
Vues:
63
This message has been marked as a message which has helped to the initial question of the thread.
See a first sample I googled (bottom of the thread) here
http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/43e8bc3a-1132-453b-b950-09427e970f31

You need to google on 'SMO run SQL Script .NET'

Another link
http://mkdot.net/blogs/boban/archive/2008/08/07/run-a-sql-script-files-in-c.aspx

(I hate the black background of the blog)

I posted a solution a while ago here in response to Michel Fournier, but I don't remember in which forum and quick search didn't find it.

>Charles, yes you do understand correctly.
>I can generate the scripts OK and get them to the laptop.
>I'm with you so far.
>My problem is how to run the script once I get it there.
>I can conceive of a C# program that turns the script into a string and uses that as the the text of an ADO.NET command.
>In theory, that will probably work, but it sounds kludgy.
>
>
>
>
>
>>>If I understand correctly, why not just generate change scripts for whatever is different on the server and put them in a folder. When the laptops come in and hookup, the go to that folder and run the change scripts. Give each script a guid as a name and let the laptops maintain a list of guids for scripts they have run, only running those that haven't been run before. Probably need to figure out sequencing but that shouldn't be too difficult, especially if you assign the guids as newsequentialguids ( or just some other id system )
>
>Redgate tools could probably make the script generation pretty easy.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform