Tutorials for writing Stored Procedures...

  • Can anybody tell me where I can find the Tutorials for writing Stored Procedures? Please help me I am new to Stored Procedures.

    Waiting 4 rply....

  • Prashant - the best place to look up EVERYTHING - not just stored procedures - is BOL (Books on line)!!!







    **ASCII stupid question, get a stupid ANSI !!!**

  • A stored procedure is nothing more than saving the code you write in a query analyzer window so that you can run it again.

    If in QA you write

    select top 5 * from MyTable

    you can save it as a stored procedure.

    Create procedure MyFirstSProc

    as

    select top 5 * from MyTable

    and you can run it by writing  MyFirstSProc in QA

    With parameters

    ****************

    If in QA you write

    select top 5 * from MyTable

    where field1 = 'abc'

    and field2 = 123

    you can save it as a stored procedure.

    Create procedure MySecondSProc @field1 varchar(10), @field2 int

    as

    select top 5 * from MyTable

    where field1 = @field1

    and field2 = @field2

    and you can run it by writing  MySecondSProc 'abc', 123  in QA

     

  • This isn't a tutorial...but a geat book for anyone starting to program SQL server.

    Murach’s SQL for SQL Server

    http://www.murach.com/books/sqls/index.htm

  • I don't know about online tutorials, but if you are new to stored procedures, I'd definitely recommend a book, The Guru's Guide to Transact-SQL by Ken Henderson or another book like that. A book will cover a lot of the 'gotchas' like XACT_ABORT, @@NESTLEVEL, @@Error and @@ROWCOUNT, etc.  

    I agree with the above post about the Murach book as well.

  • Beginning SQL Server 2000 Programming by Dewson from Wrox has 2 chapters (out of 20 total chapters) that are dedicated to Stored Procs.

    The following is from Informit.com

    SQL Server Stored Procedure Basics" is a sample chapter from The Guru's Guide to SQL Server Stored Procedures, XML, and HTML (Addison-Wesley, 2001, ISBN 0201700468), by Ken Henderson This chapter introduces you to stored procedures and XML in an HTML environment.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply