Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Storedprocedureprob - CSV

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-02-27 : 12:38:44
sur writes "HI all,

I want to write a storeprocedure to get
the details of sites for the selected districts..
this is wrote...


CREATE PROCEDURE dbo.Dr_spDRSites(@District Varchar(1000)) AS
BEGIN

begin
select sun_site as Site,site_name as Sitename
from oper_type_new, oper_sundata
where oper_type_new.sun_site = oper_sundata.site_id and district_type in( @District)
group by sun_site,site_name
end
end

GO

i will pass input paramter like this ...'88010','88020'..so on
if i give one exec Dr_spDRSites '88010' this is working
but i give this exec Dr_spDRSites '88010','88020'
this is giving the following error

Server: Msg 8144, Level 16, State 2, Procedure Dr_spDRSites, Line 0
Procedure or function Dr_spDRSites has too many arguments specified.

so let me know how to sort the prob
and the district_type in the table is varchar(15)

thanks
S"

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2003-02-27 : 12:38:44
If you read the FAQ you'll find links to some articles on handling CSV values.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-02-27 : 13:52:58
Take a look at:

http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=24172

It discusses parsing the input parameters, in this case for column names.

Brett

8-)

Go to Top of Page
   

- Advertisement -