Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save a value
Message
From
24/11/2006 14:34:05
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Save a value
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01172323
Message ID:
01172323
Views:
50
Hello.

I have the next store procedure:

CREATE PROCEDURE dbo.abc2
@server varchar(20),
@base varchar(20),
AS
DECLARE @pnCampo3 numeric(19,5)
DECLARE @cad varchar(1000)
set @pnCampo3 = 0.0
set @cad='select MAX(NOTEINDX) from ['+@server+'].['+@base+'].[dbo].[SY03900] '
exec(@cad)
set @pnCampo3=@pnCampo3+1.0
GO

but I need get the value of [exec(@cad)] in a variable in order to add (1) to the result, for example if [exec(@cad)] = 5 I need get 5+1=6.

I put somthing like this but is a error:
set @pnCampo3=exec(@cad)

How can I do this?
Next
Reply
Map
View

Click here to load this message in the networking platform