Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Sample mySQL routine/procedure similar to MS SQL stored procedure

Avatar of TSFLLC
TSFLLC asked on
Microsoft SQL ServerMySQL Server
3 Comments1 Solution851 ViewsLast Modified:
Unfortunately new to mySQL...  been using MS SQL for # years.  Want to get my feet wet with mySQL.
Have created a database in mySQL and want to create similar 'procedures' as I would use in MS SQL.

I'm including a simple stored procedure I would create in MS SQL passing parameters from VB.NET for a SELECT.

Could someone show me what it would look like in mySQL?  I've been looking at 'passing parameters' examples.  Lost as to whether a MS SQL stored procedure is saved in mySQL as a routine or what?

Quick learner.  :-)
Thanks.
USE [A_DATABASE]
GO
/****** Object:  StoredProcedure [dbo].[SPS_SelectItems]    Script Date: 05/18/2011 21:21:35 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[SPS_SelectItems]
@CompanyID bigint
AS
SELECT a.*
FROM purch_item a
WHERE a.company_id = @CompanyID
ORDER BY a.item_description