Open Imran-imtiaz48 opened 1 week ago
@Imran-imtiaz48 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
@microsoft-github-policy-service agree [company="{your company}"]
Options:
- (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
- (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"
Declare Variable: The script starts by declaring a variable @DBName to hold the database name. Check for Existence: It checks if the database exists. Close Existing Connections: If the database exists, it closes all existing connections by setting the database to SINGLE_USER mode with immediate rollback of active transactions. Drop the Database: It then drops the database. Error Handling: After attempting to drop the database, it checks again if the database still exists. If it does, it raises an error indicating there are still open connections.