Solved

MS SQL STORED PROCEDURE

Posted on 2011-09-07
3
204 Views
Last Modified: 2012-05-12
Hi guys
The code below produces an error
I am trying to retrieve selecred customers with a stored procedure
Can someone show me the right code
thanks
Dory

CREATE PROCEDURE Findcustomer
@strcust VARCHAR (10)
AS
SELECT cust_no,co_name,city,zip
FROM customer
WHERE co_name LIKE = '%@cust%'
GO
0
Comment
Question by:dory550
  • 2
3 Comments
 
LVL 39

Expert Comment

by:appari
ID: 36500960
CREATE PROCEDURE Findcustomer
@strcust VARCHAR (10)
AS
SELECT cust_no,co_name,city,zip
FROM customer
WHERE co_name LIKE = '%' + @strcust  + '%'
GO
0
 
LVL 39

Accepted Solution

by:
appari earned 500 total points
ID: 36500962
try this (forgot to remove =)

CREATE PROCEDURE Findcustomer
@strcust VARCHAR (10)
AS
SELECT cust_no,co_name,city,zip
FROM customer
WHERE co_name LIKE '%' + @strcust  + '%'
GO
0
 

Author Closing Comment

by:dory550
ID: 36500996
Thanks for your help
Dory
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now