SQLTeam.com | Weblogs | Forums

Sql error won upload


#1

wat is wrong vi this .....

/****** Object: Table [dbo].[st_HowFound] Script Date: 06/07/2010 18:33:41 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[st_HowFound](
[id] [tinyint] NOT NULL,
[description] varchar NOT NULL,
CONSTRAINT [PK_st_HowFound] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/
Object: Table [dbo].[SiteNews] Script Date: 06/07/2010 18:33:41 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SiteNews](
[date] [datetime] NOT NULL,
[title] varchar NOT NULL,
[description] varchar NOT NULL,
CONSTRAINT [PK_SiteNews] PRIMARY KEY CLUSTERED
(
[date] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/
Object: Table [dbo].[ResultsBingoWinners] Script Date: 06/07/2010 18:33:41 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResultsBingoWinners](
[bingo_id] [int] NOT NULL,
[user_id] [int] NOT NULL,
[prize] [numeric](12, 2) NOT NULL
) ON [PRIMARY]
GO
/
Object: Table [dbo].[ResultsBingo] Script Date: 06/07/2010 18:33:41 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResultsBingo](
[id] [int] IDENTITY(1,1) NOT NULL,
[date] [datetime] NOT NULL,
[turn_type] [bit] NOT NULL,
[pattern_idx] [tinyint] NOT NULL,
[ticket_value] [numeric](12, 2) NOT NULL,
[winner_num_balls] [int] NULL,
[total_bet] [numeric](12, 2) NULL,
[total_prize] [numeric](12, 2) NULL,
[confirmation_date] [datetime] NULL,
[cancellation_date] [datetime] NULL,
CONSTRAINT [PK_ResultsBingo] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/
Object: Table [dbo].[ReservedTicketsBingo] Script Date: 06/07/2010 18:33:41 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReservedTicketsBingo](
[bingo_id] [int] NOT NULL,
[user_id] [int] NOT NULL,
[tickets] [int] NOT NULL,
[date] [datetime] NOT NULL,
[confirmation_date] [datetime] NULL,
[cancellation_date] [datetime] NULL
) ON [PRIMARY]
GO
/
Object: Table [dbo].[Log_Chat] Script Date: 06/07/2010 18:33:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Log_Chat](
[id] [int] IDENTITY(1,1) NOT NULL,
[user_id] [int] NOT NULL,
[date] [datetime] NOT NULL,
[message] varchar NOT NULL,
CONSTRAINT [PK_Log_Chat] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO


#2

"Wrong" in which sense? Are you getting an error? You would like a design review? What's the question here?


#3

get this error ...
Der blev fundet 6561 fejl under analysen.

Unexpected character. (near "" at position 1)
Unexpected character. (near "" at position 3)
Unexpected character. (near "" at position 5)
Unexpected character. (near "" at position 7)
Unexpected character. (near "" at position 9)
Unexpected character. (near "" at position 11)
Unexpected character. (near "" at position 13)
Unexpected character. (near "" at position 29)
Unexpected character. (near "" at position 31)
Unexpected character. (near "" at position 33)
Unexpected character. (near "" at position 35)
Unexpected character. (near "" at position 37)
Unexpected character. (near "" at position 39)
Unexpected character. (near "" at position 41)
Unexpected character. (near "" at position 43)
Unexpected character. (near "" at position 45)
Unexpected character. (near "[" at position 46)
Unexpected character. (near "" at position 47)
Unexpected character. (near "" at position 49)
Unexpected character. (near "" at position 51)
Unexpected character. (near "" at position 53)
Unexpected character. (near "]" at position 54)
Unexpected character. (near "" at position 55)
Unexpected character. (near "" at position 57)
Unexpected character. (near "[" at position 58)
Unexpected character. (near "" at position 59)
Unexpected character. (near "" at position 61)
Unexpected character. (near "" at position 63)
Unexpected character. (near "" at position 65)
Unexpected character. (near "" at position 67)
Unexpected character. (near "" at position 69)

Notice in .\libraries\sql-parser\src\UtfString.php#129
Uninitialized string offset: 12379

Backtrace

.\libraries\sql-parser\src\Lexer.php#428: SqlParser\UtfString->offsetGet(integer 12329)
.\libraries\sql-parser\src\Lexer.php#257: SqlParser\Lexer->parseKeyword()
.\libraries\sql-parser\src\Lexer.php#209: SqlParser\Lexer->lex()
.\libraries\sql-parser\src\Parser.php#366: SqlParser\Lexer->__construct(
,
boolean false,
)
.\libraries\sql-parser\src\Utils\Query.php#379: SqlParser\Parser->__construct(string )
.\libraries\parse_analyze.lib.php#28: SqlParser\Utils\Query::getAll(string )
.\import.php#800: PMA_parseAnalyze(
string ,
string 'bingo',
)


#4

It's a problem qith your parser. It's perfectly valid T-SQL. Maybe youre parser supports a different dialect (mysql? Oracle?)?


#5

how do i do that ?? im new to sql


#6

How do you do what? What are you trying to do?


#7

i wont my websit to work ..but i cant` figur out to upload the sql


#8

Sorry, but I think we need much more context in order to be helpful.


#9

do you mean the whole SQL database


#10

Is it Microsoft SQL Server? or something else like MySQL, Oracle, PostgreSQL, etc?

Given that the error message appears to be from phpmyadmin? my guess is that you are using MySQL.

The SQL you have posted looks like Microsoft SQL. Mostly it will work fine in other SQLs but there are definitely Bits and Pieces in there (like "GO" which is only there to separate the statements) which probably won't work on anything else.

You'll probably find that the "[" and "]" surrounding object names may also not work, and probably the "dbo" schema too ... in fact now I look at it there is probably a lot that won't work "as-is"


#11

is ther a program to fix this or how do i edit the []


#12

You still haven't said what brand of SQL you are using, so impossible to say what the "fix" would be.

If it is a different type of SQL then, like I said, it is unlikely that people here, who are knowledgeable about Microsoft SQL Server, will know about other brands - so you would be better off asking on a site specific to the version of SQL you are trying to use.


#13

im using MSSQL on myasp.net


#14

im trying in mysql to and i get this error
SQL-forespørgsel:

SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[st_HowFound]( [id] [tinyint] NOT NULL, [description] varchar NOT NULL, CONSTRAINT [PK_st_HowFound] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[SiteNews]( [date] [datetime] NOT NULL, [title] varchar NOT NULL, [description] varchar NOT NULL, CONSTRAINT [PK_SiteNews] PRIMARY KEY CLUSTERED ( [date] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ResultsBingoWinners]( [bingo_id] [int] NOT NULL, [user_id] [int] NOT NULL, [prize] [numeric](12, 2) NOT NULL ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ResultsBingo]( [id] [int] IDENTITY(1,1) NOT NULL, [date] [datetime] NOT NULL, [turn_type] [bit] NOT NULL, [pattern_idx] [tinyint] NOT NULL, [ticket_value] [numeric](12, 2) NOT NULL, [winner_num_balls] [int] NULL, [total_bet] [numeric](12, 2) NULL, [total_prize] [numeric](12, 2) NULL, [confirmation_date] [datetime] NULL, [cancellation_date] [datetime] NULL, CONSTRAINT [PK_ResultsBingo] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ReservedTicketsBingo]( [bingo_id] [int] NOT NULL, [user_id] [int] NOT NULL, [tickets] [int] NOT NULL, [date] [datetime] NOT NULL, [confirmation_date] [datetime] NULL, [cancellation_date] [datetime] NULL ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Log_Chat]( [id] [int] IDENTITY(1,1) NOT NULL, [user_id] [int] NOT NULL, [date] [datetime] NOT NULL, [message] varchar NOT NULL, CONSTRAINT [PK_Log_Chat] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Log]( [id] [int] IDENTITY(1,1) NOT NULL, [user_id] [int] NOT NULL, [log_type] [tinyint] NOT NULL, [date] [datetime] NOT NULL, [description] varchar NOT NULL, [value] [numeric](12, 2) NOT NULL, CONSTRAINT [PK_Log] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Confirm]( [user_id] [int] NOT NULL, [guid] varchar NOT NULL, [registered] [datetime] NOT NULL ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[BonusRangesOnBuy]( [credits] [numeric](12, 2) NOT NULL, [bonus_percentage] [numeric](5, 2) NOT NULL ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[MiscConfigurations]( [bingo_mega_freq_days] [smallint] NOT NULL, [bingo_mega_freq_minutes] [int] NOT NULL, [bingo_normal_freq_days] [smallint] NOT NULL, [bingo_normal_freq_minutes] [int] NOT NULL, [friend_credits] [numeric](12, 2) NOT NULL, [friend_friend_credits] [numeric](12, 2) NOT NULL, [friend_friend_friend_credits] [numeric](12, 2) NOT NULL, [bingo_accum] [numeric](12, 2) NOT NULL, [bingo_percent_prize] [numeric](5, 2) NOT NULL, [bingo_percent_accum] [numeric](5, 2) NOT NULL, [bingo_price_mega] [numeric](12, 2) NOT NULL, [jackpot_percent_prize] [numeric](5, 2) NOT NULL, [jackpot_initial_accum] [numeric](12, 2) NOT NULL, [jackpot_chance_accum] [numeric](5, 2) NOT NULL, [jackpot_min_bet] [numeric](12, 2) NOT NULL, [jackpot_max_bet] [numeric](12, 2) NOT NULL, [poker_percent_prize] [numeric](5, 2) NOT NULL, [poker_initial_accum] [numeric](12, 2) NOT NULL, [poker_chance_accum] [numeric](5, 2) NOT NULL, [poker_min_bet] [numeric](12, 2) NOT NULL, [poker_max_bet] [numeric](12, 2) NOT NULL ) ON [PRIMARY] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[p_InsertLogChat] @user_id int, @message varchar(512) AS BEGIN SET NOCOUNT ON

MySQL returnerede: Dokumentation

#1193 - Ukendt systemvariabel 'ANSI_NULLS'


#15

The target database seems to be MySQL, which is NOT Microsoft SQL Server. Different SQL dialects, different technology, different syntax... different everything.


#16

try to upload it to my MSSQL server to my website ant is say the sam error


#17

How?

SAME? as in "MySQL returnerede: Dokumentation" ? if so that is, clearly, a MySQL error and not an MSSQL one.


#18

hvilken slags database har du? er det Microsoft SQL server eller Oracle MSSQL

"what we have here is a failure to communicate"
google translate baby!


#19

try these online tools that convert mssql query to mysql query
http://www.sqlines.com/online

SET @ANSI_NULLS ON
GO
SET @QUOTED_IDENTIFIER ON
GO
SET @ANSI_PADDING ON
GO
CREATE TABLE [dbo].[st_HowFound](
[id] [tinyint] NOT NULL,
[description] [varchar](50) NOT NULL,
CONSTRAINT [PK_st_HowFound] PRIMARY KEY CLUSTERED 
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET @ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[SiteNews] Script Date: 06/07/2010 18:33:41 ******/
SET @ANSI_NULLS ON
GO
SET @QUOTED_IDENTIFIER ON
GO
SET @ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SiteNews](
[date] Datetime2 NOT NULL,
[title] [varchar](128) NOT NULL,
[description] [varchar](4096) NOT NULL,
CONSTRAINT [PK_SiteNews] PRIMARY KEY CLUSTERED 
(
[date] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET @ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[ResultsBingoWinners] Script Date: 06/07/2010 18:33:41 ******/
SET @ANSI_NULLS ON
GO
SET @QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResultsBingoWinners](
[bingo_id] [int] NOT NULL,
[user_id] [int] NOT NULL,
[prize] [numeric](12, 2) NOT NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[ResultsBingo] Script Date: 06/07/2010 18:33:41 ******/
SET @ANSI_NULLS ON
GO
SET @QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResultsBingo](
[id] [int] IDENTITY(1,1) NOT NULL,
[date] Datetime2 NOT NULL,
[turn_type] [bit] NOT NULL,
[pattern_idx] [tinyint] NOT NULL,
[ticket_value] [numeric](12, 2) NOT NULL,
[winner_num_balls] [int] NULL,
[total_bet] [numeric](12, 2) NULL,
[total_prize] [numeric](12, 2) NULL,
[confirmation_date] Datetime2 NULL,
[cancellation_date] Datetime2 NULL,
CONSTRAINT [PK_ResultsBingo] PRIMARY KEY CLUSTERED 
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[ReservedTicketsBingo] Script Date: 06/07/2010 18:33:41 ******/
SET @ANSI_NULLS ON
GO
SET @QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReservedTicketsBingo](
[bingo_id] [int] NOT NULL,
[user_id] [int] NOT NULL,
[tickets] [int] NOT NULL,
[date] Datetime2 NOT NULL,
[confirmation_date] Datetime2 NULL,
[cancellation_date] Datetime2 NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Log_Chat] Script Date: 06/07/2010 18:33:41 ******/
SET @ANSI_NULLS ON
GO
SET @QUOTED_IDENTIFIER ON
GO
SET @ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Log_Chat](
[id] [int] IDENTITY(1,1) NOT NULL,
[user_id] [int] NOT NULL,
[date] Datetime2 NOT NULL,
[message] [varchar](512) NOT NULL,
CONSTRAINT [PK_Log_Chat] PRIMARY KEY CLUSTERED 
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET @ANSI_PADDING OFF
GO

#20

this is the syste on the server
MSSQL 2014, 2012, 2008, 2005 1 1 6 Unlimited
SQL Data Hosted on Separate Servers Yes Yes Yes Yes
SQL DBO Rights, Store Procedures

tried what you said, I would think my database is missing a lot of info now
her is a pic