Hi Guys,
I have mySQL running on a Windows 2008 box. It's fine, I've setup databases, tables, etc.
However, I'm trying to get some scripts running.
I have a script to create a database, and I have scripts to create tables.
However, if I run the following script (and the db doesn't exist), the table is being inserted into an existing database.
Is there something I can add to this code to keep the table that is created after the db to be inserted into the same DB?
I want tbl_adCategories inserted into dbAds. I'm guessing I need to declare dbAds in the create table script?
CREATE SCHEMA `dbAds`;
CREATE TABLE `tbl_adCategories`(
`categoryID` int(11) NOT NULL AUTO_INCREMENT,
`categoryParentName` varchar(30) NULL,
`categoryName` varchar(31) NOT NULL,
`categoryStatus` varchar(16) NOT NULL,
`categoryParentID` char(10) NULL,
PRIMARY KEY (`categoryID`),
UNIQUE KEY `categoryID_UNIQUE` (`categoryID`))
I have mySQL running on a Windows 2008 box. It's fine, I've setup databases, tables, etc.
However, I'm trying to get some scripts running.
I have a script to create a database, and I have scripts to create tables.
However, if I run the following script (and the db doesn't exist), the table is being inserted into an existing database.
Is there something I can add to this code to keep the table that is created after the db to be inserted into the same DB?
I want tbl_adCategories inserted into dbAds. I'm guessing I need to declare dbAds in the create table script?
CREATE SCHEMA `dbAds`;
CREATE TABLE `tbl_adCategories`(
`categoryID` int(11) NOT NULL AUTO_INCREMENT,
`categoryParentName` varchar(30) NULL,
`categoryName` varchar(31) NOT NULL,
`categoryStatus` varchar(16) NOT NULL,
`categoryParentID` char(10) NULL,
PRIMARY KEY (`categoryID`),
UNIQUE KEY `categoryID_UNIQUE` (`categoryID`))