MSSQL zu Mysql umschreiben

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • MSSQL zu Mysql umschreiben

    hi leute
    ich habe vor ein server für ein spiel zu erstellen
    die database di den serverfiles bei lagen sind für MSSQL
    ich wollte den server auf gerne mir MySql 5 hosten (Mysql verstehe ich,MSSQL nicht)
    da wollte ich mal fragen ob jemand zeit und lust hat diesen code um zuschreiben
    Code:
    USE [WAREMU_DBF]
    GO
    /****** Object:  Table [dbo].[ACCOUNT_TBL]    Script Date: 08/02/2010 21:06:10 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[ACCOUNT_TBL](
        [userID] [bigint] NOT NULL,
        [username] [varchar](32) NOT NULL,
        [nickname] [varchar](32) NULL,
        [password] [varchar](32) NOT NULL,
        [accesslevel] [int] NOT NULL,
        [status] [int] NOT NULL
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object:  Table [dbo].[ACCOUNT_DETAIL_TBL]    Script Date: 08/02/2010 21:06:11 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[ACCOUNT_DETAIL_TBL](
        [userID] [bigint] NOT NULL,
        [banDate] [varchar](19) NOT NULL,
        [banTime] [bigint] NOT NULL,
        [lastIP] [varchar](16) NOT NULL,
        [lastLogin] [varchar](19) NOT NULL
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object:  StoredProcedure [dbo].[uspUnBan]    Script Date: 08/02/2010 21:06:21 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[uspUnBan]
        @uUserID BIGINT
    AS
    BEGIN
        SET NOCOUNT ON;
        
        IF EXISTS(SELECT a.username FROM ACCOUNT_TBL a, ACCOUNT_DETAIL_TBL b 
                      WHERE a.userID = @uUserID AND b.userID = @uUserID)
            BEGIN
                UPDATE ACCOUNT_DETAIL_TBL SET banDate = '0000-00-00 00:00:00', banTime = 0 WHERE userID = @uUserID
                SELECT fError = '0/0'
            END
        ELSE
            BEGIN
                SELECT fError = '1/0'
            END
        
        SET NOCOUNT OFF;
    END
    RETURN
    
    -- fError 0/0: Succeeded
    -- fError 1/0: Error
    GO
    /****** Object:  StoredProcedure [dbo].[LOGIN_STR]    Script Date: 08/02/2010 21:06:21 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[LOGIN_STR]
        @uUsername VARCHAR(32), 
        @uPassword VARCHAR(32)
    AS
    BEGIN
        SET NOCOUNT ON;
        
        IF EXISTS(SELECT a.username FROM ACCOUNT_TBL a, ACCOUNT_DETAIL_TBL b 
                      WHERE a.userID = b.userID AND a.username = @uUsername)
            BEGIN
                IF EXISTS(SELECT username FROM ACCOUNT_TBL  
                        WHERE username = @uUsername AND password = @uPassword)
                    BEGIN
                        SELECT    fError =    CASE     WHEN a.status = 1
                                                        THEN '3/0'
                                                    WHEN b.banTime = -1
                                                        THEN '4/0'
                                                    WHEN b.banTime > 0
                                                        THEN ('5/' + CONVERT(VARCHAR, a.userID, 0) + '/' + CONVERT(VARCHAR, b.banDate, 0) + '/' + CONVERT(VARCHAR, b.banTime, 0))
                                                    ELSE ('0/' + CONVERT(VARCHAR, a.userID, 0) + '/' + CONVERT(VARCHAR, a.nickname, 0))
                                            END
                        FROM ACCOUNT_TBL a, ACCOUNT_DETAIL_TBL b 
                            WHERE a.userID = b.userID AND a.username = @uUsername AND a.password = @uPassword
                    END
                ELSE
                    BEGIN
                        SELECT fError = '2/0'
                    END
            END
        ELSE
            BEGIN
                SELECT fError = '1/0'
            END
        
        SET NOCOUNT OFF;
    END
    RETURN
    -- fError 0/USERID/NICKNAME: Login succeed
    -- fError 1/0: Account not exists
    -- fError 2/0: Wrong Password
    -- fError 3/0: Already Online
    -- fError 4/0: Account Banned
    -- fError 5/USERID/DATE/TIME: Account Banned with Time
    GO
    /****** Object:  Default [DF_ACCOUNT__accesslevel]    Script Date: 08/02/2010 21:06:11 ******/
    ALTER TABLE [dbo].[ACCOUNT_TBL] ADD  CONSTRAINT [DF_ACCOUNT__accesslevel]  DEFAULT ((0)) FOR [accesslevel]
    GO
    /****** Object:  Default [DF_ACCOUNT__status]    Script Date: 08/02/2010 21:06:11 ******/
    ALTER TABLE [dbo].[ACCOUNT_TBL] ADD  CONSTRAINT [DF_ACCOUNT__status]  DEFAULT ((0)) FOR [status]
    GO
    /****** Object:  Default [DF_ACCOUNT_DETAIL_TBL_banDate]    Script Date: 08/02/2010 21:06:11 ******/
    ALTER TABLE [dbo].[ACCOUNT_DETAIL_TBL] ADD  CONSTRAINT [DF_ACCOUNT_DETAIL_TBL_banDate]  DEFAULT ('0000-00-00 00:00:00') FOR [banDate]
    GO
    /****** Object:  Default [DF_ACCOUNT_DETAIL_TBL_banTime]    Script Date: 08/02/2010 21:06:11 ******/
    ALTER TABLE [dbo].[ACCOUNT_DETAIL_TBL] ADD  CONSTRAINT [DF_ACCOUNT_DETAIL_TBL_banTime]  DEFAULT ((0)) FOR [banTime]
    GO
    /****** Object:  Default [DF_ACCOUNT_DETAIL_TBL_lastIP]    Script Date: 08/02/2010 21:06:11 ******/
    ALTER TABLE [dbo].[ACCOUNT_DETAIL_TBL] ADD  CONSTRAINT [DF_ACCOUNT_DETAIL_TBL_lastIP]  DEFAULT ('000.000.000.000') FOR [lastIP]
    GO
    /****** Object:  Default [DF_ACCOUNT_DETAIL_TBL_lastLogin]    Script Date: 08/02/2010 21:06:11 ******/
    ALTER TABLE [dbo].[ACCOUNT_DETAIL_TBL] ADD  CONSTRAINT [DF_ACCOUNT_DETAIL_TBL_lastLogin]  DEFAULT ('0000-00-00 00:00:00') FOR [lastLogin]
    GO
    wenn das jemand tun würde hatte er was gut bei mir

    ich packe die datei gzipt noch mal ind den anhang
    Angehängte Dateien
    Zuletzt geändert von biotonne; 09.07.2011, 20:02.

  • #2
    Hallo,

    Nur zur Info: falls sich niemand meldet, kannst du immer noch ein Jobangebot inserieren. Bis dahin verschiebe ich es nach Projekthilfe.

    Gruß,

    Amica
    [COLOR="DarkSlateGray"]Hast du die [COLOR="DarkSlateGray"]Grundlagen zur Fehlersuche[/color] gelesen? Hast du Code-Tags benutzt?
    Hast du als URL oder Domain-Beispiele example.com, example.net oder example.org benutzt?
    Super, danke!
    [/COLOR]

    Kommentar

    Lädt...
    X