Slashdot Mirror


Beginning SQL Server 2005 Express

Graeme Williams writes "Beginning SQL Server 2005 Express Database Applications with Visual Basic Express and Visual Web Developer Express from Novice to Professional is in two parts, "Working with SQL Server Express" and "Working with Visual Basic Express and Visual Web Developer Express". The first part of the book is quite a bit larger (368pp vs. 204pp), so the title, as long as it is, isn't all that accurate. How about, "An introduction to SQL Server 2005 Express, including desktop and web applications in Visual Basic"? The book asks to be judged against a high standard: Can it turn a SQL and Visual Basic novice into a professional? The first part of the book is an excellent introduction to SQL Server in its several manifestations, and essential for anyone who is new to SQL Server 2005 Express. The second part doesn't provide as much help for the complete beginner, but still provides a good introduction to developing database applications." Read the rest of Graeme's review. Beginning SQL Server 2005 Express Database Applications author Rick Dobson pages xxi + 596 publisher Apress rating 8 reviewer Graeme Williams ISBN 1-59059-523-8 summary An excellent introduction to SQL Server 2005 Express and a

The first part of Beginning SQL Server 2005 Express, on SQL Server Express, covers a large amount of material. Starting with a basic introduction to SQL, the book builds in two directions, covering more complicated SQL as well as SQL Server Express administration. In 368 pages, you'd naturally expect a fair amount of information, but it's also thorough and well-organized. One test of how well an introductory book is organized is whether you can usefully keep it on your shelf to refer to later, and I think Beginning SQL Server 2005 Express passes that test very well. You can verify the breadth of topics covered by looking at the online table of contents and the author's web site for the book, which is detailed enough to be a very clear summary of what the book covers.

The generous amount of material downloadable from the web site includes all the SQL scripts from part one – these samples alone represent an excellent introduction to SQL (or T-SQL, as Microsoft insists on calling it). There's also a 60-page bonus chapter, not included in the book, on ASP .NET.

The explanation of SQL Server administration is a big bonus for the book, and it clearly lays out the difference between SQL Server 2005 and its smaller brother, the Express Edition, as well as the changes from SQL 2000. While I was reading this book, I had to do some simple database administration on a couple of SQL 2000 databases, one a production server, and the book gave me a very useful head start. If you found yourself upgrading from SQL Server Express to a larger and more complicated SQL Server configuration, Beginning SQL Server 2005 Express wouldn't give you everything you needed to know, but it would provide a good introduction.

Beginning SQL Server 2005 Express was published in December 2005, after the release of Microsoft's SQL Server 2005 Express but while SQL Server Management Studio Express was (and still is) only available as a "Community Technology Preview". I took the risk and installed it, and it seems fine, connecting both to a local instance of SQL Server 2005 Express and a remote SQL Server 2000.

It's inevitable in an introduction that some material be covered too hastily. For example, Dobson suggests that a database constraint could be used to ensure that a purchase amount is less than a particular dollar limit unless an approver name is also present in the database record. But that's a business rule that shouldn't be included in the database schema. At a minimum, the book might have mentioned the distinction. There's a good discussion of data types, which is somewhat weakened by not being prescriptive enough. Should I use the bit data type because they're small and will squeeze into tight spaces, or avoid them because of the unpacking overhead, if any? The book doesn't say.

There's one omission from the book that may trip you up when you try to run some of the Visual Basic examples, specifically code that attempts to attach a database file to the Server. The access privileges for the database server naturally depend on the user id it's running under, and the default installation uses a special Windows account which doesn't have access to your whole system. For running the examples, the simplest (and least secure) solution is to change the user id to your own account, which you can do using the SQL Server Configuration Manager, shown in Figure 1-4 on page 18. I guess the most secure solution is to create a new account whose privileges are limited to a specific directory, but I'm certainly not an expert in this area. Beginning SQL Server 2005 Express doesn't discuss it at all.

The second part of Beginning SQL Server 2005 Express, "Working with Visual Basic Express and Visual Web Developer Express", begins with a superficial introduction to Visual Basic. The problem is that it won't be enough for people who are new to Visual Basic, and it's not necessary for people who are familiar with it. The examples are solid but not outstanding.

Example 5 in Chapter 9, "Introduction to Visual Basic Express and Windows Forms", provides a nice example of a landmine Microsoft has laid in our path: In a Windows application, Console.WriteLine() writes to the Output->Debug window, but Debug.WriteLine() writes to the Immediate window. The example would have been easier to follow if that gem had been explained. But like the rest of the book, there's a lot of useful information in the chapter. I guess my only quibble is that in using "Novice" in the title, the book promises more than it delivers, at least in this area. This isn't suitable for a beginner to Visual Basic.

Like many other books about Visual Basic Express, Beginning SQL Server 2005 Express has a couple of chapters about building web sites using ASP .NET. It seems to me that Microsoft wants Visual Basic Express and SQL Server Express (both of which are free) to be gateway drugs to ASP .NET and IIS. The book repeats the canard that IIS is a free web server for Windows 2000, Windows XP and Windows 2003, but that's not true. IIS is included in Windows XP Professional but not Windows XP Home. In any case, Microsoft would love to get you hooked on IIS.

The other problem with ASP .NET is that so much of the action is behind the curtain. So, any example is going to have a sequence of steps in the web page designer, and perhaps a small amount of code or HTML, followed by magic, followed a web page being generated. I have nothing against magic, but it means that any narrative or explanation of examples is going to jump from "what you do at design time" to "what happens at run time" with a greater or lesser gap in the middle. Here's an example (page 565):
Normally, a False setting for the AutoPostBack property of a server-based control, such as TextBox1, does not let the control operate automatically after you commit a value to it. However, a special setting on a Define Parameters wizard screen causes TextBox1 to return its value to the server immediately after a user presses the Enter key on the keyboard. The Define Parameters wizard screen is one of series that you can pass through when you reconfigure a data source with a wizard.
Dobson actually does a great job of navigating this particular example, in the sense that he makes it clear what incantations will produce the desired effect – submitting a single value to the server for use in a database query(!).

The rest of part two deals with Visual Basic and ADO .NET, starting with a good introduction to the ADO .NET architecture As in the first part of the book, Dobson does a very good job of presenting a great deal of very useful information. ADO .NET includes two different APIs, an untyped API where column names and types can be determined at runtime by querying the database, and a strongly typed API constructed by the Visual Studio IDE at design time. The IDE reads column names and types from the database and builds an XML description it uses to build and type an API specific to each table. Dobson presents the more complicated untyped API first, which I think is the right approach, since it then makes clear what the IDE and runtime libraries are doing under the covers to manage the typed API.

The Visual Basic examples include connecting to both SQL Server and Access, parsing data out of a text file or Excel, handling concurrency errors, and a very thorough walk-through of the usual suspects: creating and deleting tables and inserting, updating and deleting rows, from a single table or multiple tables. The examples are great at making clear how ADO and related parts of .NET work, but they didn't strike me as brilliant code – not necessarily the sort of thing you want to keep to cut and paste into your next project.

In my opinion, Beginning SQL Server 2005 Express is stronger in the area of SQL Server than it is for application development. If, like me, you're comfortable with Visual Basic but new to SQL Server, run to the bookstore – for you, this book is a 9. If you're familiar with SQL Server 2000 administration but looking to start implementing applications in the latest version of Visual Basic, check out the table of contents online. You'll find a lot to like, even if the book doesn't match your needs perfectly."

You can purchase Beginning SQL Server 2005 Express Database Applications from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

6 of 92 comments (clear)

  1. All you need is......... by kkelly · · Score: 3, Informative

    Microsoft developer network at htt:\\msdn.microsoft.com IMHO its probably more information than most developers might need to accomplish a given task or learn about 2k5 MS technology. Don't sleep, msdn has some excellent content and the coverage of the new SQL 2005 implementation is fairly extensive. Most books I buy collect dust after just a few weeks.......

    --
    K
  2. Save $14.80! by Anonymous Coward · · Score: 1, Informative

    Save yourself $14.80 by buying the book here: Beginning SQL Server 2005 Express. And if you use the "secret" A9.com discount, you can save an extra 1.57%!

  3. my two cents by deuterium · · Score: 5, Informative

    The other problem with ASP .NET is that so much of the action is behind the curtain

    Well, from what I gather, Ruby on Rails hides database access pretty thoroughly as well. WebDev systems exist for the purpose of that very concept... making standard operations into black boxes.
    I've been using the new SQL Express in a project over the last several months. It's quite nice for a free, distributable DB, and the Management Studio download has been much nicer than the old 2000 version (or the Postgres Admin tool I used before this). A book like this would have been handy, as there aren't a lot of comprehensive resources on the web for Express.

    I feel a 400 post platform diatribe coming up...

  4. Re:Interesting by AaronBrethorst · · Score: 5, Informative

    Howdy - you should take a look at the VS 2005 setup bootstrapper. It'll simplify the process of getting SQL Server Express (SSE) installed onto a deployment machine. You will need to install an instance of SSE onto the deployment machine, though. SSE is a walking, talking, gum-chewing SQL database. There's a pretty useful article over on MSDN Magazine that will walk you through the basics.

    --
    No, but I used to work for Microsoft.
  5. Re:ASP.NET - The cobol of our generation? by TheNetAvenger · · Score: 2, Informative

    They've alienated their Basic programmer base by forcing them to relearn the language.. AGAIN. None of the old asp pages can be copied and pasted into aspx. Is it really necessary to create registry keys for everything, such as form controls? This is why they're giving Visual Basic Express out for free.

    Ok, you must not be a serious VB Programmer. The objection to VB6 to VB.NET was not learning a 'new language' as the changes were minimal. The objection was the Runtime distribution required for VB.NET was .NET instead of being distributing the VB 6 Runtimes. Also VB had finally moved created 'independant' applications without the need for the VB Runtime, and some developers really wanted that, and not to be tied back to a Runtime (.NET).

    The part the VB Developers tend to forget or the reason it doesn't matter anymore is that 99% of the Windows installation ALREADY have .NET installed via MS Updates, SP2, etc. So the Runtime distribution of .NET is no longer the factor it was. With Vista this disappears as the .NET framework (runtime) is included in the OS on install.

    So the changes were not 'vast' to the language, it was more about the runtime requirements and FORCING VB developers to use Managed Code.

    The trick here is this. VB was NEVER a performance language, you couldn't easily drop to assembly level programing anyhow. And it was virtually 'managed code' all along, so this was not a major change or loss of performance, just a change in the dependant runtime/sandbox to .NET.

    None of the old asp pages can be copied and pasted into aspx

    This is NOT 100% true. Sure there 'can' be minor syntax changes, but there are ALSO pages that can run in ASP.NET and no programming changes are required to the native ASP page. So you are missing the differences here, there are many times ASP Pages can be put into an ASP.NET Application without modification.

    Is it really necessary to create registry keys for everything, such as form controls?

    Um, no it isn't who told you this was how Windows Program were written? The registry is for only the storage of centralized information, and has nothing to do with form control NOR should EVER be used to store constructs of your applications such as form controls. That is what is contained in the binaries of your application. PERIOD.

  6. Re:ASP.NET - The cobol of our generation? by TheNetAvenger · · Score: 2, Informative

    Truly no offense, but if these are really your questions, there is a lot more than syntax differences between ASP and ASP.NET that you do not get.

    Little things like VB is not ASP.NET or ASP.

    Stricter Typing is an option of ASP.NET, but NOT required. Check your Server Development environment, but don't assume it is broken or significantly different.

    ASP has also changed over the years and based on Server configuration commands like:
    Form.Request("Name")

    will break in newer version and you have to change the statement to just:

    Request("Name")

    This does not mean anything other than an evolving set of technologies, and the server configuration environment of which they are ran in.

    Oh one more thing...
    Why does IIS not have any support for Server Side languages other than js, vb, and cs

    Who said it ONLY supports VB, C#, and JavaScript? IIS is VERY extensible and can handle anything .NET uses, so this adds a whole new range and level of languages. In addition to ISAPI and other plug in methods for handling pages, which is how a lot of people work independantly in everything from PHP to Python. (Python also can be accessed directly from the .NET constructs as well, just you can Pascal and MANY other languages).

    So whatever teacher told you IIS only supported VB, JS, or CS where either stupid or lying to you.

    IIS itself didn't even 'inherently' support any native language, initial ASP and VB and JavaScript support was via ISAPI modules, just like PHP is handled today.

    Truly spend some time looking this stuff up, don't even take my word for ANYTHING. Especially if you are limiting yourself to VB or C# because you think it is the ONLY support language IIS supports.

    Also anyone reading this post, if you are in an IIS development situation and don't understand the extensibility offered by IIS, take time to find out for yourself, you are NOT locked into ANY language.

    VB, JS, and CS are the examples MS uses, but that is because those are their bread and butter, not because that is all IIS knows. ;)