Start learning with our library of video tutorials taught by experts. Get started

SQL Server: Triggers, Stored Procedures, and Functions

Configuring your environment


From:

SQL Server: Triggers, Stored Procedures, and Functions

with Martin Guidry

Video: Configuring your environment

Before I get into my demonstrations, I'd like to help you set up a development environment very similar to what I'm using so you can perform these steps at home. We are going to be using two products: Microsoft SQL Server 2012 Express Edition and Microsoft Visual Web Developer 2010 Express Edition. First let's look at SQL Server 2012 Express Edition. You can find that add the URL www.microsoft.com/express/database.
Expand all | Collapse all
  1. 2m 15s
    1. Welcome
      51s
    2. What you should know
      51s
    3. Using the exercise files
      33s
  2. 11m 1s
    1. Comparing triggers, functions, and procedures
      3m 25s
    2. Why use a stored procedure?
      4m 59s
    3. Why use functions?
      1m 27s
    4. Why use triggers?
      1m 10s
  3. 6m 2s
    1. Configuring your environment
      4m 53s
    2. Downloading and installing a sample database
      1m 9s
  4. 26m 25s
    1. Creating a stored procedure
      2m 46s
    2. Modifying a stored procedure
      2m 34s
    3. Returning data using data sets
      3m 45s
    4. Returning data using cursors
      3m 45s
    5. Using input and output parameters
      5m 24s
    6. Using security and permissions
      5m 24s
    7. Using transactions
      2m 47s
  5. 11m 56s
    1. Creating a user-defined function
      4m 59s
    2. Exploring single-value functions
      4m 18s
    3. Exploring table value functions
      2m 39s
  6. 9m 31s
    1. Using "after" triggers
      3m 47s
    2. Using "instead of" triggers
      2m 9s
    3. Using nested triggers
      1m 38s
    4. Using database-level triggers
      1m 57s
  7. 12m 43s
    1. Exploring a real-world INSERT procedure
      5m 32s
    2. Exploring a real-world UPDATE procedure
      3m 13s
    3. Implementing logging on DELETE
      3m 58s
  8. 19m 38s
    1. Understanding the Common Language Runtime (CLR) and the .NET framework
      1m 52s
    2. Using CLR with SQL Server 2012
      4m 11s
    3. Writing stored procedures with C# .NET
      5m 51s
    4. Writing functions with .NET
      5m 7s
    5. Choosing between T-SQL vs. CLR
      2m 37s
  9. 11m 34s
    1. Creating a basic web form and connecting to a database
      2m 56s
    2. Executing a stored procedure
      2m 4s
    3. Passing parameters
      3m 41s
    4. Getting return values
      2m 53s
  10. 1m 43s
    1. Next steps
      1m 43s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
SQL Server: Triggers, Stored Procedures, and Functions
1h 52m Advanced Sep 24, 2012

Viewers: in countries Watching now:

This course investigates several key database-programming concepts: triggers, stored procedures, functions, and .NET CLR (Common Language Runtime) assemblies. Author Martin Guidry shows how to combine these techniques and create a high-quality database using Microsoft SQL Server 2012. The course also covers real-world uses of the INSERT, UPDATE, and DELETE procedures, and how to build a basic web form to connect to your database.

Topics include:
  • Comparing triggers, functions, and stored procedures
  • Installing and configuring SQL Server
  • Creating a stored procedure
  • Returning data using data sets
  • Creating user-defined functions
  • Using "after," "instead," and nested triggers
  • Modifying existing stored procedures
  • Implementing logging on DELETE
  • Choosing between T-SQL and CLR
  • Executing a stored procedure
  • Passing parameters
Subjects:
Developer Databases
Software:
SQL Server
Author:
Martin Guidry

Configuring your environment

Before I get into my demonstrations, I'd like to help you set up a development environment very similar to what I'm using so you can perform these steps at home. We are going to be using two products: Microsoft SQL Server 2012 Express Edition and Microsoft Visual Web Developer 2010 Express Edition. First let's look at SQL Server 2012 Express Edition. You can find that add the URL www.microsoft.com/express/database.

This takes me to the standard landing page for SQL Server Express Edition. I have a big red button in the middle of the screen. I'll click on that and it shows me some different choices. You definitely want to get one of the versions that has the database engine and the tools include Sequels Server Management Studio which is an important tool in many of our demos. So I'm going to with the top one here. That takes me to another page where I'll select the 64-bit edition Express with Tools.

Now that we've downloaded SQL Server 2012 Express Edition let's go ahead and install it. So in this interface I want the top option New SQL Server stand-alone installation, and I'd like to perform a new installation of SQL Server 2012, so the default there is appropriate. I'll click Next. I need to read and accept the license and then click Next. I need to choose what features I'm going to install.

I definitely want the Management Tools. The SQL Server Replication is not necessary for anything we're going to do in the course, but you could install if you want though. Click Next. At this point I'd like to name this instance. You can use whatever name you want, probably do something descriptive. I can choose a folder to install to. I'm going to accept the default and click Next. Here it's asking me which service accounts I would like to use.

In a tested environment I typically accept the defaults here. If you'd like to use something other than the default accounts, you may do so. This interface is asking me which authentication mode I would prefer. One of our demos will require SQL Server authentication. So I'm going to click Mixed Mode to allow SQL Server authentication. That will force me to import a password for the SA account. So I'm going to of when to use a secure password.

It also has automatically added the current user as an administrator of SQL Server. That's typically something you'll want to do. If you want to add additional users, you can do so in the interface at the bottom. Asking me whether or not I want to send error reports to Microsoft, I'll just click Next and now we are installing. I should mention we are installing SQL Server version 2012. Many of the demos I'll be doing would work exactly the same in 2008 or 2005.

So if we have that kind of environment already set up, you could stick with that. I also anticipate that the majority of the stuff in the course will not change in a future version. So when Microsoft releases the next version of SQL Server, I can't be 100% sure but I imagine the basics of triggers, functions, and stored procedures will still work the same. In this sense your SQL Server 2012 installation completed successfully with product updates. Sounds like good news. I'll close this and then I can also close this window and we have successfully installed SQL Server.

Now it's time to install Microsoft Visual Studio Web Developer 2010 Express. You can get this from www.microsoft.com/express. This takes me to a landing page for Visual Studio 2010 Express products. There are a few different versions. I'll scroll down. The one I'm interested in is all the way here to the right, Visual Web Developer 2010 Express.

I'll click Install at the bottom and I'll need to accept the licensing agreement, and here we have a message saying the following products were successfully installed. That sounds like good news. I'll click on Finish and I'll click in Exit and we have successfully installed Microsoft Visual Web Developer 2010 Express Edition.

There are currently no FAQs about SQL Server: Triggers, Stored Procedures, and Functions.

Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed SQL Server: Triggers, Stored Procedures, and Functions.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked