I get the error Database does not exist when executing CREATE DATABASE
and USE
statements at the same time.
This is the ms sql server version I’m using:
Microsoft SQL Server 2022 (RTM) – 16.0.1000.6 (X64) Oct 8 2022 05:58:25 Copyright (C) 2022 Microsoft Corporation Express Edition (64-bit) on Windows 10 Home 10.0 <X64> (Build 19045: )
When I click execute button in SSMS to run script with commands like below:
CREATE DATABASE SalesManagement;
USE SalesManagement;
In the result tag there is a message:
Msg 911, Level 16, State 1, Line 2
Database 'SalesManagement' does not exist. Make sure that the name is entered correctly.
Why does this error appear? And how to fix it?
Thanks!
2