2 Replies - 4520 Views - Last Post: 15 October 2007 - 01:59 AM

#1 ffabulous1   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-October 07

HELP! MySQL syntax error 1064. Trying to run a query

Posted 13 October 2007 - 07:58 PM

I'm using Godaddy's MySQL (phpadmin) to run a query & set up the tables in my database but keep getting the following error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if exists (select * from sysobjects where id = object_id(N'[dbo].[Acreage]') and' at line 1


Here's a clip of the script I'm using to establish these tables. Please help me. I've searched high & low to figure this out and fix the syntax error but I get nothing. I'm only fairly familiar with database programming.


/****** Object:  Table [dbo].[Acreage]	Script Date: 4/26/2004 9:07:03 AM ******/
if exists (select * from sysobjects where id = object_id(N'[dbo].[Acreage]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Acreage]
GO


/****** Object:  Table [dbo].[Agent]	Script Date: 4/26/2004 9:07:03 AM ******/
if exists (select * from sysobjects where id = object_id(N'[dbo].[Agent]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Agent]
GO

/****** Object:  Table [dbo].[Acreage]	Script Date: 4/26/2004 9:07:16 AM ******/
CREATE TABLE [dbo].[Acreage] (
	[UD] [datetime] NULL ,
	[ADD_BL1] [int] NULL ,
	[ADD_BL2] [int] NULL ,
	[AR] [int] NULL ,
	[BILW] [char] (1) NULL ,
	[BLK] [varchar] (4) NULL ,
	[BR] [int] NULL ,
	[BWQ] [varchar] (3) NULL ,
	[BWSP] [varchar] (3) NULL ,
	[CITY] [varchar] (15) NULL ,
	[CLD] [datetime] NULL ,
	[CNTY] [varchar] (13) NULL ,
	[CO] [varchar] (6) NULL ,
	[CP] [int] NULL ,
	[CPP] [int] NULL ,
	[D1] [varchar] (76) NULL ,
	[D2] [varchar] (76) NULL ,
	[D3] [varchar] (76) NULL ,
	[DIR] [varchar] (2) NULL ,
	[DIST] [varchar] (4) NULL ,
	[ED] [datetime] NULL ,
	[EQUITY] [varchar] (8) NULL ,
	[ES] [varchar] (15) NULL ,
	[ES_BUS] [char] (1) NULL ,
	[FEE_AMT] [int] NULL ,
	[FIN_NO] [varchar] (2) NULL ,
	[FP] [char] (1) NULL ,
	[GEO_STATUS] [varchar] (2) NULL ,
	[HS] [varchar] (14) NULL ,
	[HS_BUS] [char] (1) NULL ,
	[INET] [char] (1) NULL ,
	[LA] [varchar] (12) NULL ,
	[LA2] [varchar] (12) NULL ,
	[LA2B] [varchar] (8) NULL ,
	[LA2N] [varchar] (16) NULL ,
	[LA2P] [varchar] (8) NULL ,
	[LAGR] [varchar] (40) NULL ,
	[LB] [varchar] (8) NULL ,
	[LD] [datetime] NULL ,
	[LDR] [datetime] NULL ,
	[LGL] [varchar] (76) NULL ,
	[LL] [varchar] (4) NULL ,
	[LMO] [varchar] (8) NULL ,
	[LN] [int] NOT NULL ,
	[LOT] [varchar] (4) NULL ,
	[LP] [int] NULL ,
	[LPSQ] [varchar] (11) NULL ,
	[LTDM] [varchar] (18) NULL ,
	[MAP] [varchar] (4) NULL ,
	[MAP_OK] [char] (1) NULL ,
	[MC] [char] (2) NULL ,
	[MPK1] [varchar] (3) NULL ,
	[MPK4] [varchar] (3) NULL ,
	[MS] [varchar] (14) NULL ,
	[MS_BUS] [char] (1) NULL ,
	[MT] [varchar] (4) NULL ,
	[NBO] [char] (1) NULL ,
	[OLD_MAP] [varchar] (3) NULL ,
	[OLD_SIDE] [varchar] (3) NULL ,
	[OLD_TOP] [varchar] (3) NULL ,
	[OLKN] [varchar] (30) NULL ,
	[OLP] [int] NULL ,
	[OMD] [datetime] NULL ,
	[OWN] [varchar] (29) NULL ,
	[OWNP] [varchar] (12) NULL ,
	[PAGE] [varchar] (4) NULL ,
	[PB] [varchar] (4) NULL ,
	[PCD] [datetime] NULL ,
	[PHOT] [char] (1) NULL ,
	[PNS] [varchar] (3) NULL ,
	[R1] [varchar] (76) NULL ,
	[R2] [varchar] (76) NULL ,
	[R3] [varchar] (76) NULL ,
	[R4] [varchar] (76) NULL ,
	[R5] [varchar] (76) NULL ,
	[RP] [int] NULL ,
	[RTMD] [datetime] NULL ,
	[SA] [varchar] (12) NULL ,
	[SBIZ] [varchar] (3) NULL ,
	[SCD] [varchar] (6) NULL ,
	[SD] [datetime] NULL ,
	[SEC] [varchar] (4) NULL ,
	[SGRD] [varchar] (2) NULL ,
	[SHO] [varchar] (40) NULL ,
	[SIDEC] [varchar] (3) NULL ,
	[SMO] [varchar] (8) NULL ,
	[SO] [varchar] (8) NULL ,
	[SP] [int] NULL ,
	[SPSQ] [varchar] (11) NULL ,
	[STAT] [varchar] (4) NULL ,
	[STN] [varchar] (6) NULL ,
	[STRT] [varchar] (22) NULL ,
	[SUBD] [varchar] (18) NULL ,
	[SWIFT] [char] (1) NULL ,
	[TAX] [int] NULL ,
	[TGRD] [char] (1) NULL ,
	[TID] [varchar] (24) NULL ,
	[TOPC] [varchar] (3) NULL ,
	[TXYR] [int] NULL ,
	[TYP] [char] (2) NULL ,
	[UNIT] [char] (2) NULL ,
	[VRC] [char] (1) NULL ,
	[YR] [int] NULL ,
	[ZIP] [varchar] (5) NULL ,
	[ZIP4] [char] (4) NULL ,
	[ACCS] [varchar] (40) NULL ,
	[ACDM] [varchar] (24) NULL ,
	[ACRE] [int] NULL ,
	[AHSE] [char] (1) NULL ,
	[AUTO] [char] (1) NULL ,
	[BACP] [int] NULL ,
	[BAF] [int] NULL ,
	[BAH] [int] NULL ,
	[BASE] [char] (1) NULL ,
	[BBRN] [int] NULL ,
	[BCRS] [char] (1) NULL ,
	[BEEF] [char] (1) NULL ,
	[BHRD] [int] NULL ,
	[BLDG] [varchar] (40) NULL ,
	[BWTR] [char] (1) NULL ,
	[CAP] [int] NULL ,
	[CPS] [char] (1) NULL ,
	[CULT] [int] NULL ,
	[DACP] [int] NULL ,
	[DARY] [char] (1) NULL ,
	[DBRN] [int] NULL ,
	[DCRS] [char] (1) NULL ,
	[DHRD] [int] NULL ,
	[DOC_AF] [varchar] (40) NULL ,
	[DWTR] [char] (1) NULL ,
	[AP_EXP] [varchar] (7) NULL ,
	[FARH] [char] (1) NULL ,
	[FEED] [char] (1) NULL ,
	[FHSE] [char] (1) NULL ,
	[FLRS] [varchar] (2) NULL ,
	[GAR] [int] NULL ,
	[HACP] [int] NULL ,
	[HBRN] [int] NULL ,
	[HHRD] [int] NULL ,
	[HORS] [char] (1) NULL ,
	[HSE] [char] (1) NULL ,
	[HSHD] [char] (1) NULL ,
	[HWTR] [char] (1) NULL ,
	[IRRI] [char] (1) NULL ,
	[LKE] [int] NULL ,
	[MD] [varchar] (8) NULL ,
	[MILK] [char] (1) NULL ,
	[MISC] [varchar] (40) NULL ,
	[ACRES_OPEN] [int] NULL ,
	[ORCH] [int] NULL ,
	[PAST] [int] NULL ,
	[PFIN_AF] [varchar] (40) NULL ,
	[PHSE] [int] NULL ,
	[PINC] [int] NULL ,
	[PINE] [int] NULL ,
	[POSS] [varchar] (40) NULL ,
	[POUL] [char] (1) NULL ,
	[TR_PROC] [char] (1) NULL ,
	[PULP] [int] NULL ,
	[RDFR] [int] NULL ,
	[RENT] [char] (1) NULL ,
	[RIDE] [char] (1) NULL ,
	[SACP] [char] (1) NULL ,
	[SEP] [char] (1) NULL ,
	[SEPL] [char] (1) NULL ,
	[SHRD] [int] NULL ,
	[PH_SIZE] [varchar] (7) NULL ,
	[STAL] [int] NULL ,
	[STBL] [char] (1) NULL ,
	[SWIN] [char] (1) NULL ,
	[TACC] [int] NULL ,
	[TIMB] [int] NULL ,
	[TINC] [int] NULL ,
	[TOPO] [varchar] (40) NULL ,
	[TREE] [char] (1) NULL ,
	[TRMS] [int] NULL ,
	[TRUC] [char] (1) NULL ,
	[TSHD] [int] NULL ,
	[TXRT] [int] NULL ,
	[UTIL] [varchar] (40) NULL ,
	[VAL] [int] NULL ,
	[WOOD] [int] NULL ,
	[XMAS] [int] NULL ,
	[TREE_YEAR] [int] NULL ,
	[ZONE] [varchar] (40) NULL
) ON [PRIMARY]
GO


/****** Object:  Table [dbo].[Agent]	Script Date: 4/26/2004 9:07:16 AM ******/
CREATE TABLE [dbo].[Agent] (
	[Agent_ID] [varchar] (12) NOT NULL ,
	[Office_ID] [varchar] (8) NOT NULL ,
	[AgentType] [varchar] (3) NULL ,
	[AgentFirstName] [varchar] (12) NULL ,
	[AgentLastName] [varchar] (17) NULL ,
	[AgentAddress] [varchar] (30) NULL ,
	[AgentCity] [varchar] (21) NULL ,
	[AgentState] [char] (2) NULL ,
	[AgentZipCode] [varchar] (5) NULL ,
	[AgentPhone] [varchar] (10) NULL ,
	[AgentEmail] [varchar] (80) NULL ,
	[AgentWebAddress] [varchar] (80) NULL ,
	[AgentStatus] [char] (1) NULL ,
	[SQLUpdate] [datetime] NULL
)
GO



*Always use code tags when posting your code :)

This post has been edited by PsychoCoder: 15 October 2007 - 01:58 AM


Is This A Good Question/Topic? 0
  • +

Replies To: HELP! MySQL syntax error 1064. Trying to run a query

#2 snoj   User is offline

  • Married Life
  • member icon

Reputation: 93
  • View blog
  • Posts: 3,583
  • Joined: 31-March 03

Re: HELP! MySQL syntax error 1064. Trying to run a query

Posted 13 October 2007 - 08:11 PM

That kinda looks like MSSQL types of stuff.
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: HELP! MySQL syntax error 1064. Trying to run a query

Posted 15 October 2007 - 01:59 AM

Well your biggest problem is thats not mySQL syntax, thats Transact-SQL, used with Microsoft SQL Server and Microsoft Access. This cannot be used for mySQL
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1