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
 SQL Server Development (2000)
 Stored Procedures

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-29 : 17:25:31
meeta writes "i want to pass in the fields to multiple and i want to return the answer to the calling function.

CREATE PROCEDURE sp_trial
@field1 varchar(16),
@field2 varchar(16),
@Total int OUTPUT

As
select @total=@field1 * @field2 from table where uid='787'


return(@Total)
GO
but it does not work as @field1 and @field2 are varchar and @Total is int. I even tried converting the string into integer but that also does not work.

thank you"

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-01-29 : 17:33:15
Hi

You will need some Dynamic SQL for this
http://www.sqlteam.com/SearchResults.asp?SearchTerms=dynamic



Damian
Go to Top of Page
   

- Advertisement -