SQL Server 2008 / C# - Update layout of database
-
Hi! I have a small C# program that runs in multiple instances over a LAN and uses a database running on a seperate server. Now I need to make changes to the database layout by adding a few tables and extending an existing table with a few more columns. How do I do this the right way? Can anybody point me in the direction of a tutroial or such information to get me started? If it helps : The database is "Microsoft SQL Database 2008" and C# is the 2008 flavour. Sure, I can make a new database and then export/import the from the old database, but I would much rather use a update through an installation-package so that the person updating don't have to be a certified tech. This change need's to be done on several locations and some of the users are just that - users ;) Thanks in advance!
-
Hi! I have a small C# program that runs in multiple instances over a LAN and uses a database running on a seperate server. Now I need to make changes to the database layout by adding a few tables and extending an existing table with a few more columns. How do I do this the right way? Can anybody point me in the direction of a tutroial or such information to get me started? If it helps : The database is "Microsoft SQL Database 2008" and C# is the 2008 flavour. Sure, I can make a new database and then export/import the from the old database, but I would much rather use a update through an installation-package so that the person updating don't have to be a certified tech. This change need's to be done on several locations and some of the users are just that - users ;) Thanks in advance!
I'd write a script and ask them to run it.
-
Hi! I have a small C# program that runs in multiple instances over a LAN and uses a database running on a seperate server. Now I need to make changes to the database layout by adding a few tables and extending an existing table with a few more columns. How do I do this the right way? Can anybody point me in the direction of a tutroial or such information to get me started? If it helps : The database is "Microsoft SQL Database 2008" and C# is the 2008 flavour. Sure, I can make a new database and then export/import the from the old database, but I would much rather use a update through an installation-package so that the person updating don't have to be a certified tech. This change need's to be done on several locations and some of the users are just that - users ;) Thanks in advance!
Will the applications be running when you do the update? When you say "several locations" you mean that there are the database itself exists in several locations? Probably the absolute easiest way from the users stand point would be the following 1. Create a C# program that does nothing by applies the changes. Do NOT put this in the main app. 2. Create an installer which runs that app. It might also update the real app, see below. Also as a suggestion the following might be useful. 1. Create a table which the sole purpose is to keep track of the database schema version. Thus for this release you would insert into that table something like 'MyApp', '2.0', 2. Have your application verify the version on start up and refuse to run (error message) if the version does not match. If you do this your C# database update program can verify the database version before applying the update. Note as well that you do not need to embed the update SQL in the database update application. It can read it from an included SQL file.
-
Will the applications be running when you do the update? When you say "several locations" you mean that there are the database itself exists in several locations? Probably the absolute easiest way from the users stand point would be the following 1. Create a C# program that does nothing by applies the changes. Do NOT put this in the main app. 2. Create an installer which runs that app. It might also update the real app, see below. Also as a suggestion the following might be useful. 1. Create a table which the sole purpose is to keep track of the database schema version. Thus for this release you would insert into that table something like 'MyApp', '2.0', 2. Have your application verify the version on start up and refuse to run (error message) if the version does not match. If you do this your C# database update program can verify the database version before applying the update. Note as well that you do not need to embed the update SQL in the database update application. It can read it from an included SQL file.
Thanks! That sounds like what I need :) Small clarification for posterity: Each LAN installation has one databas and several C#-clients. THis installation is then done on several LANs.