Improve ALTER SCHEMA, sp_rename, and sys.sql_modules#335
Merged
craigg-msft merged 12 commits intoMicrosoftDocs:livefrom Jan 17, 2018
Merged
Improve ALTER SCHEMA, sp_rename, and sys.sql_modules#335craigg-msft merged 12 commits intoMicrosoftDocs:livefrom
craigg-msft merged 12 commits intoMicrosoftDocs:livefrom
Conversation
`OBJECT_DEFINITION` is the actual source for the `definition` column here.
This function is the source of the `sys.sql_modules.definition` column anyway.
1. Changed "schema-contained" to be "schema-scoped" to be consistent with https://docs.microsoft.com/en-us/sql/t-sql/functions/object-name-transact-sql and https://docs.microsoft.com/en-us/sql/t-sql/functions/object-schema-name-transact-sql 2. Copied two paragraphs of remarks from https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-rename-transact-sql and adjusted to be appropriate in this context 3. Removed "or view" from SSMS instructions since first new "caution" paragraph recommends against using `ALTER SCHEMA` on views. 4. Fixed `IMPERSONATION` permission (which doesn't exist) to be the actual `IMPERSONATE` permission
Contributor
|
@srutzky : Thanks for your contribution to the SQL documentation! The author, @edmacauley, has been notified to review your proposed change. |
Contributor
|
Thanks @srutzky for your clarity edits. #sign-off |
Contributor
|
Only the author, @edmaca, can sign off on this pull request. |
Contributor
|
Thank you @srutzky and @edmacauley |
Contributor
Author
|
@edmacauley and @craigg-msft : you are quite welcome 😄 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sys.sql_modulesAdded link to
OBJECT_DEFINITIONpage in the "Description" column fordefinition. Execute the following to see thatOBJECT_DEFINITIONis the source for thedefinitioncolumn:But even if it wasn't the source, it still outputs the same value.
ALTER SCHEMAandsp_renameOBJECT_DEFINITIONfunction page forsp_rename.ALTER SCHEMAon views 😉IMPERSONATIONpermission (which doesn't exist) to be the actualIMPERSONATEpermissionStored Procedure / Function / View / Trigger Definitions Can Be Wrong, Even If sp_rename Was Never Used
ALTER SCHEMARelating to the advice about the need to manually update referenced objects that have been transferred / moved, please execute the following: