There is already an object error after database is dropped Started learning SQL Server and stuck with this simple code:

drop database if exists dbo;

create database dbo;

create table dbo.a_table (a_table_a_field   int not null);


Running it twice in SSMS gives: "There is already an object named 'a_table' in the database."

Seems that I do it in completely wrong way. Please, help.
You’ve created a database called dbo but you’re creating the table in the current database. Try adding this before the create table statement:

USE dbo;


I might choose a different database name, too. dbo has specific meaning in SQ Server.