MySQL Forums
Forum List  »  Microsoft SQL Server

Changing code from SQL Server 2000 to mysql
Posted by: wickes1
Date: October 25, 2005 06:35AM

I originally created the database on Microsoft SQL Server 2000. I want to change the code to Mysql so I can create a new database. I have php myadmin how would I do that? Thanks

<!--- --------------------------- SQL Create Script Begins ---------------------------- --->
if exists (select * from sysobjects where id = object_id(N'[dbo].[Categories]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Categories]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[Clients]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Clients]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[Products]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Products]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[PurchasedProducts]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PurchasedProducts]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[WebCart]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[WebCart]
GO

CREATE TABLE [dbo].[Categories] (
[int_CategoryID] [int] IDENTITY (1, 1) NOT NULL ,
[txt_Category] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[bit_Active] [bit] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Clients] (
[int_ClientID] [int] IDENTITY (1, 1) NOT NULL ,
[txt_ClientName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[txt_ClientEmail] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[txt_Username] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[txt_Password] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[bit_Active] [bit] NULL ,
[int_CFID] [int] NULL ,
[txt_CFTOKEN] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Products] (
[int_ProductID] [int] IDENTITY (1, 1) NOT NULL ,
[txt_ProductTitle] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[txt_ProductDescription] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[flt_ProductPrice] [float] NULL ,
[bit_Active] [bit] NULL ,
[int_CategoryID] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[PurchasedProducts] (
[int_saleCart] [int] IDENTITY (1, 1) NOT NULL ,
[int_ClientID] [int] NULL ,
[int_ProductID] [int] NULL ,
[int_Quantity] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[WebCart] (
[int_CartID] [int] IDENTITY (1, 1) NOT NULL ,
[int_ProductID] [int] NULL ,
[int_Quantity] [int] NULL ,
[int_ClientID] [int] NULL
) ON [PRIMARY]
GO
<!--- --------------------------- SQL Create Script Ends ---------------------------- --->

Options: ReplyQuote


Subject
Written By
Posted
Changing code from SQL Server 2000 to mysql
October 25, 2005 06:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.