Monday, February 13, 2012

Beginner to SQL server 2005 Express Edition

Hi,

I am fairly new to Visual Studio 2005 (using C#) and am writing an application for the company I work in. I have got a really nice functioning form working and am now planning what to do about the massive database I need to create (I don't think it will ever get to the 4GB limitation of SQL Server 2005 Express Edition).

Can someone please help with some simple questions please?

1: I am decoding a specific file format and extracting the information for the main database. Fortunately, each record in the data file I am decoding has unique identity codes (so this will be great for the ID of each entry). Because the software has to do this by itself (the encoded file contains more than 1,120,000 records which will shrink to about 30,000 records, all different sizes once decoded). Can each record in a SQL server database contain a different number of elements? If so, what is this known as (I have read a little about jagged arrays - is there a similar thing in SQL server databases)?

2: As the program will decode the file and assemble the database, can I make my program create the database from scratch and manipulate the database rather than me having to define a database for my program to fill? If so, where can I find some info on doing this?

3: The database file will be stored on our office network and has to be accessible to more than one person at a time (in this case, a maximum of 6 users - well within the 25 users my book says is possible with SSE2005). Is it more complex to develop multi-user access to the database?

Just in case you wonder what books I have got, they are "Introducing Microsoft SQL Server 2005 for Developers" and "Getting Started with SQL Server 2005 Express Edition".

Thank you!

1. Yes and No. You can store the information for the missing columns as NULL, but your code will have to handle that, and the columns will need to be nullable. If the file is in a standard format (eg a spreadsheet, or a csv file), you can use DTS (or SSIS in 2005) to load the file. That would be easier than writing a custom application to load the file.

2. You can build a dynamic sql statement based on the columns and column types of the tables you want to build. However, it would be easier and safer to define the database beforehand. Building tables is easy enough, just make sure you define the relationships in the correct order, and then load the data in that order aswell. You may want to leave defining relationships until after the data is loaded, just make sure the data is concurrent.

3. I am not sure, I don't know too much about this. The database schema itself would not have to be changed, you would just have to create SQL server user accounts for each user, or use windows integrated security which is much easier to set up. Then ensure they can connect to the server which the SQL server instance is based upon.

As this is a new product, you may learn more useful and up-to-date information from the books online. Microsoft are still offering a free e-learning course on 2005:

https://www.microsoftelearning.com/sqlserver2005/default.aspx

I have used parts of it and found it useful. Books tend to be overly wordy, whereas the e-learning courses get to the point quicker.

|||

Thank you,

Your reply will help me decide where to go next.

The file I am importing is not a straight-forward data file. It is a custom file format used by the British railway industry and some code is necessary to read in the data, join some elements to form a list, then the list will be placed into the database.

The database will have some fixed elements to start with, but will then be followed by my decoded list. The decoded list will contain a different number of entries. Some lists may contain around 10 entries. Some may contain as many as 200 entries.

Sean.

No comments:

Post a Comment