Abstract
The chapters covering security have alluded to the fact that Dynamic SQL does not run in the same scope as the remainder of TSQL in the same stored procedure. In addition to breaking the ownership chain, variables declared locally and globally will not have easy access to each other. When writing application code or stored procedures, passing variables into and out requires a bit of planning, ensuring that the inputs and outputs are correct. Working with Dynamic SQL is very similar, and luckily there are a variety of ways in which to manage variables effectively without any level of inconvenience.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2016 Ed Pollack
About this chapter
Cite this chapter
Pollack, E. (2016). Managing Scope. In: Dynamic SQL. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1811-2_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-1811-2_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-1810-5
Online ISBN: 978-1-4842-1811-2
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books