IT Community - Software Programming, Web Development and Technical Support

how to create store procedure?

This is a discussion on how to create store procedure? within the Database Support forums, part of the Web Development category; example: -------- table name : users how to create store procedure in this table total count ?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-05-2008, 01:51 AM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post how to create store procedure?

example:
--------
table name : users

how to create store procedure in this table total count ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-20-2008, 04:49 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
Murali is on a distinguished road
Send a message via AIM to Murali
Default Re: how to create store procedure?

Could not able to understand your question clearly?
Can u able to tell me what u exactly need?
Did u mean to get the total number of records from a table,then it is so simple

Code:
SELECT COUNT(*) FROM table;
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-31-2008, 08:07 PM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
Murali is on a distinguished road
Send a message via AIM to Murali
Default Re: how to create store procedure?

Quote:
Originally Posted by senraj View Post
example:
--------
table name : users

how to create store procedure in this table total count ?
May be u want to know about the Create Stored Procedure Syntax?

Here is the syntax for Creating and Executing Stored Procedures in MYSQL,
Refer It.

Create-Stored Procedure
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-31-2008, 09:03 PM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Default Re: how to create store procedure?

Hi,

here i am giving sample stored procedure syntax. I hope u get basic idea about to create stored procedure

-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE <Procedure_Name, sysname, ProcedureName>
-- Add the parameters for the stored procedure here
<@Param1, sysname, @p1> <Datatype_For_Param1, , int> = <Default_Value_For_Param1, , 0>,
<@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2, , 0>
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
END
GO
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-25-2008, 05:26 AM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: how to create store procedure?

Quote:
Originally Posted by senraj View Post
example:
--------
table name : users

how to create store procedure in this table total count ?
Hi senraj,
If you want to do the process lot from others table then u can go for SP instead of using it in your page either in a separate queries.

If you get data from the given table means as Murali said use simple select Query
__________________
With,
J. Jeyaseelan

Everything Possible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

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

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/database-support/5177-how-create-store-procedure.html
Posted By For Type Date
DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 02-05-2008 02:21 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Step By Step Procedure to create project? poornima ASP and ASP.NET Programming 3 04-07-2008 01:45 AM
how to create stored procedure for view to generate xml? poornima ASP and ASP.NET Programming 3 02-24-2008 11:21 PM
Code-behind to create node dynamically using XML File or any Stored Procedure poornima ASP and ASP.NET Programming 3 02-14-2008 08:46 PM
Is it possible to create Stored Procedure in Dataset Using Distinct Key ? KiruthikaSambandam ASP and ASP.NET Programming 1 08-08-2007 07:03 AM
Can a stored procedure call itself or recursive stored procedure? How many level SP n H2o Database Support 1 08-03-2007 09:55 AM


All times are GMT -7. The time now is 01:14 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0