Probably.
(And if you want a more detailed answer, you need to ask a more detailed question.)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Could two queries share the same parameter/variable?
Probably.
(And if you want a more detailed answer, you need to ask a more detailed question.)
Hi @Jonathan Brotto
When two queries are in same batch, then it is possible.
Check this simple sample:
Declare @ID INT=10001
select * from DemoTable where ID = @ID;
select * from DemoTable where ID <> @ID;
When the two queries are not in one batch like this:
Declare @ID INT=10001
select * from DemoTable where ID = @ID;
GO
select * from DemoTable where ID <> @ID;
You might need to declare the parameter again.
Best regards,
Cosmog
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".