mmf1102
mmf1102

Reputation: 61

SQL USE database_name not not found

I am super new to SQL (as in, this is my first time ever seeing it) and I'm having some trouble getting it working. I am using SQL Server 2014. So far, this is literally all I have written:

CREATE DATABASE foo;

USE foo;

The second foo is underlined, and it says "Could not locate entry in sysdatabases for database 'foo'. No entry found with that name" What am I doing wrong/not understanding here? I can't find any other answers online.

Upvotes: 0

Views: 1012

Answers (1)

Dave Kelly
Dave Kelly

Reputation: 129

separate the commands with a 'GO'

create database foo;
GO
use foo

Upvotes: 1

Related Questions