Discussion Locked

Global Variables in SQL Server

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can I assign a global Variable to variable in a sql server stored procedure?

5 replies

by roc180

When you say global, do you mean global to an an application? If so just pass in the global variable as a parameter to the stored procedure, granted the stored procedure has to be written to take a parameter. If you need a code reference on how to do this let me know and I can provide a few ADO examples of passing parameters to a stored prodedures.

Neal Martinelli

by pvp

An example that's even useful!

declare @rowct int, @errno int
select @rowct = @@rowcount
select @errno = @@error

This discussion is closed to new replies.