Solved

MS SQL STORED PROCEDURE

Posted on 2011-09-07
3
214 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

911 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

22 Experts available now in Live!

Get 1:1 Help Now