Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Drop Table if exsists

Author  Topic 

brenkenathan
Starting Member

3 Posts

Posted - 2010-05-12 : 02:14:54
Ok I am using MAMP for Mac and when I export the table with a drop statement it doesnt want to take it back in...can someone tell me where I am going wrong, ive looked it up but seems to be right, I think?


Create database PTTest

DROP TABLE IF EXISTS PushUpScoreChartMale22to26
CREATE TABLE IF NOT EXISTS PushUpScoreChartMale22to26 (
Repetitions int(11) NOT NULL,
Score int(11) NOT NULL,
PRIMARY KEY (Repetitions)
)


DROP TABLE IF EXISTS RunScoreChartMale22to26;
CREATE TABLE IF NOT EXISTS RunScoreChartMale22to26 (
Time time NOT NULL,
Score int(11) NOT NULL,
PRIMARY KEY (Time)
)


DROP TABLE IF EXISTS SitUpScoreChartMale22to26;
CREATE TABLE IF NOT EXISTS SitUpScoreChartMale22to26 (
repetitions int(11) NOT NULL,
score int(11) NOT NULL,
PRIMARY KEY (repetitions)
)
DROP TABLE IF EXISTS SoldierData;
CREATE TABLE IF NOT EXISTS SoldierData (
LastName varchar(20) NOT NULL,
FirstName varchar(20) NOT NULL,
SSN varchar(9) NOT NULL,
Height int(11) NOT NULL,
Weight int(11) NOT NULL,
Age int(11) NOT NULL,
PushUpCount int(11) NOT NULL,
SitUpCount int(11) NOT NULL,
RunTime time NOT NULL,
PTScore int(3) NOT NULL,
PRIMARY KEY (SSN),
KEY Height_idxfk (Height),
KEY PushUpCount_idxfk (PushUpCount),
KEY SitUpCount_idxfk (SitUpCount),
KEY RunTime_idxfk (RunTime)
)


DROP TABLE IF EXISTS WeightRequirements;
CREATE TABLE IF NOT EXISTS WeightRequirements (
Height int(11) NOT NULL,
Weight int(11) NOT NULL,
PRIMARY KEY (Height)
)

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-12 : 02:22:45
This looks like MySQL but this is an MS SQL Server forum.
I think you can get better help in a MySQL forum.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-05-12 : 05:40:08
Post your question at www.mysql.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -