C# .NET - SelectStatement

Asked By ricky ponting
04-Feb-12 12:58 AM
hi

 How to write select statement in stored procedure for mysql
  dipa ahuja replied to ricky ponting
04-Feb-12 03:30 AM

DROP PROCEDURE IF EXISTS `sp1`

GO

CREATE PROCEDURE sp1

   (

      IN   p_student_id  INT(11)     

   )

BEGIN

    SELECT * FROM   students

    WHERE  student_id = p_student_id ;

END

GO

  Danasegarane Arunachalam replied to ricky ponting
04-Feb-12 12:34 PM
Here  it is


DELIMITER //
CREATE PROCEDURE MySampleProcedure()
  BEGIN
  SELECT *  FROM mytable;
  END //
DELIMITER ;


And you can call the procedure as

CALL MySampleProcedure();

Create New Account
help
stored procedure Hi how to create stored procedure for insert values into tables create procedure spInsertDetails ( @rollNo int, @name varchar(50) ) as declare @NoOfRows int select @NoOfRows = count(*) from table2 if @NoOfRows < = 0 begin insert into table2 values(@name, @rollno) end Hi, try the following stored procedure create procedure InsertUser ( @Name nvarchar(100), @Age int ) As Begin insert into Employee (Name
stored procedure What is mean by stored procedure? for all detail with examples Stored Procedure A stored procedure is a set of one or more SQL statements that are stored together in database
can u explain how to create stored procedure. . in sql server = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - - Create basic stored procedure template with TRY CATCH - - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 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
Stored Procedure hi, Can we execute a stored procedure inside another stored procedure?Plz help me urgently. . . . . Hi, yes you can execute another Stored Procedure inside a stored procedure. you can use it like this. . create procedure [StoredProcedure1] as exec
SqlParameters to be assigned values< / param> / / / <param name = "dataRow"> The dataRow used to hold the stored procedure's parameter values< / param> private static void AssignParameterValues(SqlParameter[] commandParameters, DataRow dataRow) { if ((commandParameters = = null param> / / / <param name = "transaction"> A valid SqlTransaction, or 'null'< / param> / / / <param name = "commandType"> The CommandType (stored procedure, text, etc.)< / param> / / / <param name = "commandText"> The stored procedure name or T-SQL command< / param> / / / <param name = "commandParameters"> An array of SqlParameters to be mustCloseConnection = false; } / / Associate the connection with the command command.Connection = connection; / / Set the command text (stored procedure name or SQL statement) command.CommandText = commandText; / / If we were provided a transaction, assign it