Why You Shouldn't Hardcode the Current Database Name in Your Views, Functions, and Stored Procedures

Why You Shouldn't Hardcode the Current Database Name in Your Views, Functions, and Stored Procedures

By Kendra Little on • 1 min read

Why You Shouldn't Hardcode the Current Database Name in Your Views, Functions, and Stored Procedures 1 min read
Why You Shouldn't Hardcode the Current Database Name in Your Views, Functions, and Stored Procedures

I recently published Why You Shouldn’t Hardcode the Current Database Name in Your Views, Functions, and Stored Procedures over on Simple Talk.

What the Article Covers

In the article, I discuss:

  • Why referencing the current database name creates a dependency
  • What ‘deferred name resolution’ is, and why the dependency may be more noticeable in views and some functions (rather than stored procedures)
  • Which activities are most likely to break if you place dependencies on the current database name

Read the full article here.