AUTHORIZATION
Example
Section titled “Example”CREATE DATABASE TestDBGOALTER AUTHORIZATION ON DATABASE::TestDB TO User1GOOutput
Section titled “Output”Command(s) completed successfully.
Explanation
Section titled “Explanation”The above SQL code block creates a new database named TestDB in SQL Server. Once the database is successfully created, the second statement changes the authorization of the TestDB database to User1. This means User1 now owns the TestDB database. The output shows that the command execution was successful.