Collections:
"DROP SCHEMA" - Dropping an Existing Schema in SQL Server
How To Drop an Existing Schema in SQL Server?
✍: FYIcenter.com
If you want to delete a schema, you need to move all objects out of that schema, then use the "DROP SCHEMA" statement to delete the schema. The tutorial exercise below shows you how to drop schema "fyi":
-- Login with "sa" USE FyiCenterData; GO -- Drop failed because schema is not empty DROP SCHEMA fyi; GO Msg 3729, Level 16, State 1, Line 1 Cannot drop schema 'fyi' because it is being referenced by object 'DF__fyi_links__creat__4316F928'. -- Move one table out ALTER SCHEMA dbo TRANSFER fyi.fyi_links; GO -- Delete one table DROP TABLE fyi.test; GO -- Dropped ok DROP SCHEMA fyi; GO Command(s) completed successfully.
⇒ Managing Security, Login and User in SQL Server
⇐ Accessing a Schema Not Owned by You in SQL Server
2016-10-20, 2665🔥, 0💬
Popular Posts:
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
How to convert a JSON (JavaScript Object Notation) quoted string into a regular character string usi...
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...
How AdventureWorksLT tables are related in SQL Server? There are 12 user tables defined in Adventure...
How to check if two JSON values have overlaps using the JSON_OVERLAPS() function? JSON_OVERLAPS(json...