sql imports not working into workbench

Associate
Joined
19 Jul 2006
Posts
1,847
Hope this is a simple task, I have a few sql files made for me that I need to use to make a database in mysql .
I have tried importing them into mysql workbench and I get syntax errors
heres an example file
Code:
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User]
(
	-- Data fields.
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [varchar](32) NOT NULL,
	[UserPassword] [varchar](32) NOT NULL,
	[FirstName] [varchar](50) NOT NULL,
	[LastName] [varchar](50) NOT NULL,
	[JobTitle] [varchar](50) NULL,
	[ChallengeQuestion] [varchar](200) NOT NULL,
	[ChallengeAnswer] [varchar](20) NOT NULL,

	-- DATABASE HOUSEKEEPING FIELDS.
	[IsActive] [bit] NOT NULL CONSTRAINT [DF_User_IsActive]  DEFAULT (1),
	[UpdateTimestamp] [timestamp] NOT NULL,
	[UpdateDate] [datetime] NOT NULL CONSTRAINT [DF_User_UpdateDate] DEFAULT (getdate()),
	[UpdateUserID] [int] NOT NULL,

	CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
	(
		[UserID] ASC
	)
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
)
ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO

Is there an easy way of getting that to play with MySQL?

Cheers
 

Pho

Pho

Soldato
Joined
18 Oct 2002
Posts
9,325
Location
Derbyshire
That looks like MSSQL to me, which would explain why it wouldn't work on MySQL.

You'll have to recreate it in MySQL format, which shouldn't be too difficult - if it's only a few you could just do it with the workbench GUI.

Alternatively you could set it up in MSSQL then use some sort of ETL/conversion tool to migrate it to MySQL but chances are it won't be worth the effort for a few tables.
 
Back
Top Bottom