|
-
Jul 4th, 2007, 04:14 PM
#1
Thread Starter
Frenzied Member
Database - schema creation and updates
Hi guys...
I would like some comments about how do you manage the creation and updates of a database (SQL Server) schema in a Vb.net application...
do you ask your customers to load scripts in SQL Server Management Studio (or query analiser)... or dou you make your own application to perform this task?
and what about versions... does your applications validate database schemas versions? and how do you manage to do that?
im searching for days for this matter... all i find is information about batch files calling osql... i dont consider this a good and professional solution...
thx in advance...
-
Jul 4th, 2007, 04:16 PM
#2
Thread Starter
Frenzied Member
Re: Database - schema creation and updates
...
in my previous applications i left this task to database administrators... but 99% of my customers are small companies, and dont have database administrators...
-
Jul 4th, 2007, 04:18 PM
#3
Re: Database - schema creation and updates
Yes, they check the db schema and apply alter table statements etc to update a db to a new version of an app. I never rely upon a client to run anything other then an executable update/service pack or something because they usually are not tech savy or if they do something wrong it takes forever to walk them through any type of analysis.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 4th, 2007, 04:29 PM
#4
Thread Starter
Frenzied Member
Re: Database - schema creation and updates
well... my databases have a version number...
what i am trying to do is provide the customer the sql script with a xml config file, with version/patch numbers, release dates, and some tech information... the application would have somekind of database admin section, that would check database version, impose the db update and enable the user to select the xml config file... after that would validate and execute the sql script against the database...
my problem is just i cant find how to execute a sql script generated by sql manager console without errors...
and i dont want to embed sql statements in code...
-
Jul 4th, 2007, 04:33 PM
#5
Thread Starter
Frenzied Member
Re: Database - schema creation and updates
how do you manage to run that update statements?
-
Jul 4th, 2007, 04:52 PM
#6
Re: Database - schema creation and updates
Have you looked into the DTSRUN command line utility?
Or even using OSQL in a .BAT file to run a .SQL text script?
Personally - we manage our updates to customer databases - they pay for annual maintenance and expect us to handle that end of the DBA work.
We even have full DBA contracts with some customers so that we are responsible for backups and disk space and whatever else a SQL box needs to run smooth.
-
Jul 4th, 2007, 04:58 PM
#7
Thread Starter
Frenzied Member
Re: Database - schema creation and updates
 Originally Posted by szlamany
Have you looked into the DTSRUN command line utility?
Or even using OSQL in a .BAT file to run a .SQL text script?
Personally - we manage our updates to customer databases - they pay for annual maintenance and expect us to handle that end of the DBA work.
We even have full DBA contracts with some customers so that we are responsible for backups and disk space and whatever else a SQL box needs to run smooth.
DTSRUN... let me take a look at that...
osql and bat files??? as i said...dont consider this a good and professional solution
i cant manage myself customer for db updates...
-
Jul 4th, 2007, 05:02 PM
#8
Re: Database - schema creation and updates
The osql utility is the command line version of Query Analyzer and it does take arguments and returns values too.
My updater is basic. It just verifies the tables and fields exist and if not executes the alter query to update the table to the current version.[/color]
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 4th, 2007, 05:06 PM
#9
Thread Starter
Frenzied Member
Re: Database - schema creation and updates
 Originally Posted by RobDog888
The osql utility is the command line version of Query Analyzer and it does take arguments and returns values too.
My updater is basic. It just verifies the tables and fields exist and if not executes the alter query to update the table to the current version.[/color]
sql embebbed in your application?... i want to make a tool so i dont have to create new versions only to upadte db...
-
Jul 4th, 2007, 05:11 PM
#10
Re: Database - schema creation and updates
Then you can have it read it the xml file that you were talking about. 
Like I was saying, mine is very basic as I didnt have time to make it dynamic or fancy
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 4th, 2007, 05:14 PM
#11
Thread Starter
Frenzied Member
Re: Database - schema creation and updates
and what bout first time creation... in a new customer... do it yourself?
-
Jul 4th, 2007, 05:21 PM
#12
Re: Database - schema creation and updates
If ts first time creation and not using .NET 2005 then it would also be CREATE DATABASE and GRANT statements to create the db and assign permissions to a Windows Security group. Then the end user can manually add/remove their windows users to/from that group as a way of controlling access to the program running.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 4th, 2007, 06:33 PM
#13
Re: Database - schema creation and updates
 Originally Posted by zuperman
and what bout first time creation... in a new customer... do it yourself?
There are so many issues related to this...
I've got a customer who would not give me admin rights to the SQL server. This meant they would take only a .BAK that they would RESTORE onto the server or the choice I took - they created 5 empty DB's and I used scripts myself to create objects (tables, sprocs and what not).
btw - when we used OSQL in a nightly process 5 years ago to keep a SQL box sync'd with a mainframe we developed a "review" program that would "read" the OSQL output log and look for errors.
What is so unprofessional about OSQL in your opinion?
-
Jul 5th, 2007, 05:46 AM
#14
Thread Starter
Frenzied Member
Re: Database - schema creation and updates
 Originally Posted by szlamany
What is so unprofessional about OSQL in your opinion?
...the most annoyng thing is that i cant catch errors to the user...unlike you, i havent figured out to do that
if i manage to do that i think it would be a good solution... can you explain how you do it... (dont need code, only the main steps)...
thx...
-
Jul 6th, 2007, 04:28 PM
#15
Re: Database - schema creation and updates
We got to know what the log file produced by OSQL would look like and simply opened it with a little VB program and read through it looking for errors.
You could distribute your .SQL script along with a .ExpectedLogFile with it - and after you run OSQL you compare the .LOG output to the .ExpectedLogFile with a little VB program - looking for errors.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|