Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored procedure in sql command
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01164247
Message ID:
01164263
Views:
9
>Hi all:
>
>Is it possible that we can execute a procedure(sp_amount) in a string format? Please see below.
>
>
>declare @lerror char(50), @lcserver char(20), @lcdbname char(65), @lcsqlcmd char(1000)
>select @lcserver = "[ej\jan]"
>select @lcdbname = 'nsc'
>
>select lcsqlcmd = "@lcserver.@lcdbname.dbo.sp_amount @cValue = 1, @error = @lerror output"
>execute(lcsqlcmd)
>
>
>however it gives me an error on it.
>
>Hoping for your quick response. Thanks
>
>Jan
select lcsqlcmd = @lcserver + '.' + @lcdbname + '.dbo.sp_amount @cValue = 1, @error = @lerror output'
execute(lcsqlcmd)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform