I am currently trying to make a simple database but everytime I run the script, it creates the database, but does not create any of the tables, any ideas?
use master
IF EXISTS(select * from sys.databases where name = 'MyWebDB')
DROP DATABASE MyWebDB
CREATE DATABASE MyWebDB
DROP TABLE Users
CREATE TABLE Users
(
UserID int IDENTITY PRIMARY KEY,
EmailAddress varchar(100) NOT NULL,
FirstName varchar(50) NOT NULL,
LastName varchar(50) NOT NULL,
);
CREATE TABLE Products(
ProductID int IDENTITY PRIMARY KEY,
ProductName varchar(100) NOT NULL
);
DROP TABLE Downloads
CREATE TABLE Downloads(
DownloadID int IDENTITY PRIMARY KEY,
UserID int FOREIGN KEY REFERENCES Users(UserID),
DownloadDate datetime NOT NULL,
FileName varchar(100) NOT NULL,
ProductID int FOREIGN KEY REFERENCES Products(ProductID)
);
use masterare the tables going there?