Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert ms sql syntax to mysql

Status
Not open for further replies.

ushtabalakh

Programmer
Jun 4, 2007
132
Hi there
How can I convert the syntax of the following code into mysql equivalent?

Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO

CREATE TABLE temptable(

	[mlsnumber] [varchar](11) NOT NULL,
	[Status] [varchar](3) NULL,
	[PropType] [varchar](4) NULL,
	[District] [varchar](5) NULL,
	[Address] [varchar](51) NULL,
	[ZipCode] [varchar](13) NULL,
	[StreetName] [varchar](51) NULL,
	[StreetNum] [int] NULL,
	[StreetDir] [varchar](3) NULL,
	[StreetTyp1] [varchar](5) NULL,
	[SuiteNum] [varchar](7) NULL,
	[Beds] [tinyint] NULL,
	[Baths] [decimal](7, 3) NULL,
	[LPrice] [money] NULL,
	[YrBlt] [int] NULL,
	[ListRltr1N] [varchar](51) NULL,
	[LastTransD] [int] NULL,
	[ListR1PH] [varchar](13) NULL,
	[FirmName1] [varchar](51) NULL,
	[Constructi] [varchar](6) NULL,
	[Ftype] [varchar](17) NOT NULL,
	[RoofType] [varchar](6) NULL,
	[Style] [varchar](6) NULL,
	[SiteInflue] [varchar](773) NULL,
	[Exterior] [varchar](134) NULL,
	[Parking] [varchar](504) NULL,
	[Fireplace] [varchar](225) NULL,
	[HeatingTyp] [varchar](134) NULL,
	[Features] [varchar](721) NULL,
	[Amenities1] [varchar](947) NULL,
	[BasementTy] [varchar](63) NULL,
	[BasementDe] [varchar](110) NULL,
	[Ensuite] [varchar](2) NULL,
	[GarY/N] [varchar](2) NULL,
	[FrontE] [varchar](3) NULL,
	[Region] [varchar](5) NULL,
	[RegionDesc] [varchar](26) NULL,
	[AreaDesc] [varchar](30) NULL,
	[Community] [varchar](7) NULL,
	[CommunityD] [varchar](37) NULL,
	[PUB_REMA] [varchar](1021) NULL,
	[Zone] [varchar](5) NULL,
	[TotalFlrAr] [decimal](23, 6) NULL,
	[PClass] [varchar](5) NULL,
	[TAREA] [decimal](8, 3) NULL,
	[LastImgTra] [int] NULL,
	[PictureCount] [tinyint] NULL,
	[CondoFee] [smallint] NULL,
	[Type1] [varchar](6) NULL,
	[FrontageM] [decimal](9, 3) NULL,
	[DepthM] [decimal](7, 3) NULL,
)

Is there any software that would convert ms sql code into mysql?
 
I would set the quoted identifier off and try again. That would drop all the unnecessary and non-standard identifier quoting (the [ and the ]). If your MySQL server is set to "mode ansi", you can replace them with standard identifier quotes (double quotes), otherwise you will have to use the also non-standard backquotes. As far as I know, money is not a defined type in MySQL but the rest is. So getting rid of [] almost solves your problem. You will have to decide what column type you want for the money though.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
nice one, don

another potential problem is VARCHAR over 255 -- you have to be on mysql 5.0.3 or higher

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top