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 ?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 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.. |
| |||
| Quote:
Here is the syntax for Creating and Executing Stored Procedures in MYSQL, Refer It. Create-Stored Procedure
__________________ -Murali.. |
| |||
| 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 |
| |||
| Quote:
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |