Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 19th, 2006, 12:03 AM
Authorized User
 
Join Date: Nov 2005
Location: Colombo, , Sri Lanka.
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help me to DO Stored Procedures

Hi,
 im new 4 sql server. i want to create sored procedures 4 insert,update and delete. so i dont have a knowledge to create those and i dont no how to create and wht's the goodway to do. pls help me. i need it.
thx

MSB
__________________
MSB
Reply With Quote
  #2 (permalink)  
Old October 19th, 2006, 01:58 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

start by using BOOKS ONLINE, it has great examples.

Jaime E. Maccou
Reply With Quote
  #3 (permalink)  
Old October 19th, 2006, 08:42 AM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Hi MSB,

Stored Procedure syntax is fairly straight forward. The general syntax is as follows:

CREATE PROCEDURE procedurename
    Parameters
AS
BEGIN
   SELECT
   DELETE
   UPDATE
END

Although, I agree with Jamie, Books Online will give you much more information.


Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html
Reply With Quote
  #4 (permalink)  
Old October 23rd, 2006, 01:54 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
I totallly agree with Jaime and Scott.
Here is an example of simple stored Proc for Delete statement,
///to delete particular EmpId from Employee table:
CREATE PROCEDURE DeleteParticularEmployee
@EmpId int
AS
Delete from Employee
where Emp_Id = @EmpId
GO


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Procedures KeviJay VB Databases Basics 1 June 5th, 2008 07:17 AM
stored procedures MunishBhatia SQL Server 2005 4 April 12th, 2008 01:39 AM
STORED PROCEDURES shazia1 SQL Server ASP 7 September 26th, 2007 06:11 AM
Stored Procedures itHighway SQL Server 2000 3 November 23rd, 2005 09:08 AM
Stored Procedures stu9820 Access 3 February 8th, 2004 12:13 PM



All times are GMT -4. The time now is 04:45 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.