Skip to main content

Managing Scope

  • Chapter
  • First Online:
Dynamic SQL
  • 1388 Accesses

Abstract

Our discussions of 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 we have a variety of ways in which to manage variables effectively without any level of inconvenience.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Edward Pollack

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Pollack, E. (2019). Managing Scope. In: Dynamic SQL. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4318-3_5

Download citation

Publish with us

Policies and ethics