storproc - Stored Procedures Dr. Ralph D. Westfall March,...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Stored Procedures Dr. Ralph D. Westfall March, 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Getting Database Data when using a database, there are two places where a detailed request for data can be located inside a program that is separate from the database inside the database itself a stored procedure is a previously created query or program in a database
Background image of page 2
SQL Server Stored Procedures precompiled in SQL Server so they run faster can be reused to avoid recoding make code simpler similar to subprocedures
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Creating Stored Procedures start SQL Server Management Studio expand a database>expand Programmability>right-click Stored Procedures>New Stored Procedure click Query in top menu>Specify Values for Template Parameters replace values for ProcedureName, @Param[], Datatypes and Default
Background image of page 4
Complete Stored Procedure replace SELECT statement with SQL code for the procedure parameters usually are in WHERE clause WHERE [ field ] [ compare ] @[ name ] e.g., WHERE AGE = @ age use Query>Parse to verify syntax click !Execute button to compile it File>Save (rename it)>Save
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

storproc - Stored Procedures Dr. Ralph D. Westfall March,...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online