|
You last visited: Today at 06:22
Advertisement
SHN Editor - SQL Query
Discussion on SHN Editor - SQL Query within the Fiesta Online forum part of the MMORPGs category.
04/11/2017, 00:54
|
#1
|
elite*gold: 0
Join Date: Jul 2011
Posts: 1,143
Received Thanks: 350
|
SHN Editor - SQL Query
Gibt es eine "gefixte" version vom SHN Editor wo das SQL Panel die richtigen queries auspuckt? :/
Grüße,
Venipa
|
|
|
04/11/2017, 02:03
|
#2
|
elite*gold: 0
Join Date: Sep 2013
Posts: 562
Received Thanks: 361
|
Das sql panel spuckt nur teils falsche queries aus und wurde möglicherweise auch
garnicht primär für mssql entwickelt.
mit ein paar kleinen anpassungen kannst du das query aber auch problemlos in mssql ausführen.
Als Beispiel:
Code:
DROP TABLE IF EXISTS `data_AccUpgrade`;
CREATE TABLE `data_AccUpgrade` (
`ID` INT(11) UNSIGNED,
`CriFail` SMALLINT(5) UNSIGNED,
`DownFail` SMALLINT(5) UNSIGNED,
`NormalFail` SMALLINT(5) UNSIGNED,
`nCon` SMALLINT(5) UNSIGNED,
`LuckySuc` SMALLINT(5) UNSIGNED
);
INSERT INTO `data_AccUpgrade` (`ID`,`CriFail`,`DownFail`,`NormalFail`,`nCon`,`LuckySuc`) VALUES
(1,0,0,0,100,200);
könnte zu:
Code:
if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'data_AccUpgrade' AND TABLE_SCHEMA = 'dbo')
drop table dbo.data_AccUpgrade;
CREATE TABLE data_AccUpgrade (
ID INT ,
CriFail SMALLINT,
DownFail SMALLINT ,
NormalFail SMALLINT,
nCon SMALLINT,
LuckySuc SMALLINT
);
INSERT INTO data_AccUpgrade (ID,CriFail,DownFail,NormalFail,nCon,LuckySuc) VALUES
(1,0,0,0,100,200);
werden.
Ab SQL Server 2016 kann dann auch
Code:
DROP TABLE IF EXISTS `data_AccUpgrade`;
anstelle des umständlichem
Code:
if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'data_AccUpgrade' AND TABLE_SCHEMA = 'dbo')
drop table dbo.data_AccUpgrade;
benutzt werden.
In vorherigen versionen existiert diese syntax jedoch nicht.
|
|
|
04/12/2017, 00:10
|
#3
|
elite*gold: 0
Join Date: Jul 2011
Posts: 1,143
Received Thanks: 350
|
Da sind Syntax Fehler drinnen. (Fast überall).
Hatte es fast hingekommen doch dann hat es mehr ausgespuckt.
|
|
|
04/12/2017, 00:12
|
#4
|
elite*gold: 44
Join Date: Apr 2014
Posts: 445
Received Thanks: 301
|
Schreib die Fehler mal hier rein. Vielleicht komm ich ja spontan auf ne kleine Lösung für die Queries.
|
|
|
04/12/2017, 10:53
|
#5
|
elite*gold: 0
Join Date: Jul 2011
Posts: 1,143
Received Thanks: 350
|
mssql error:
Code:
Meldung 207, Ebene 16, Status 1, Zeile 66
Invalid column name 'LeatherBoots'.
Meldung 207, Ebene 16, Status 1, Zeile 66
Invalid column name 'Leather Boots'.
mssql insert code:
Code:
INSERT INTO dItemInfo (ID,InxName,Name,Type,Class,MaxLot,Equip,ItemAuctionGroup,TwoHand,AtkSpeed,DemandLv,Grade,MinWC,MaxWC,AC,MinMA,MaxMA,MR,WCRate,MARate,ACRate,MRRate,CriRate,CriMinWc,CriMaxWc,CriMinMa,CriMaxMa,CrlTB,MaxHP,MaxSP,MaxAP,WhoEquip,BuyPrice,SellPrice,BuyFame,BuyGToken,BuyGBCoin,WeaponType,ArmorType,UpLimit,UpSucRatio,UpLuckRatio,UpResource,BasicUpInx,AddUpInx,TH,TB,ShieldAC,HitRatePlus,EvaRatePlus,MACriPlus,CriDamPlus,MagCriDamPlus,BT_Inx,TitleName,ItemGradeType,ItemUseSkill,SetItemIndex,ItemFunc,AutoMon) VALUES
(0,"LeatherBoots","Leather Boots",0,8,1,21,19,0,1000,2,1,0,0,2,0,0,0,1000,1000,1000,1000,0,0,0,0,0,0,0,0,0,62,13,2,0,0,0,0,1,9,0,0,0,60,0,0,1,0,0,0,0,0,0,0,"-",2,"-","-",0,0),
|
|
|
04/12/2017, 17:48
|
#6
|
elite*gold: 0
Join Date: Jan 2011
Posts: 1,697
Received Thanks: 615
|
Wahrscheinlich nutzt du den SHN Editor von MrFr irgendwas, da ist der Source Code ja so:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace SHNDecrypt
{
public class SQLConv
{
public static string GetSQLType(Type type)
{
if (type == typeof(byte))
{
return "TINYINT(1)";
}
else if(type == typeof(SByte)){
return "TINYINT(1) UNSIGNED";
}
else if (type == typeof(UInt32))
{
return "INT(11) UNSIGNED";
}
else if (type == typeof(ushort))
{
return "SMALLINT(5) UNSIGNED";
}
else if (type == typeof(Single))
{
return "FLOAT(10)";
}
else if (type == typeof(Int16))
{
return "SMALLINT(5)";
}
else if (type == typeof(Int32))
{
return "INT(11)";
}
else
{
return "TEXT";
}
}
public static string CreateHeader(string name, bool drop)
{
string toret = "";
if(drop) toret += "DROP TABLE IF EXISTS `" + name + "`;\r\n";
toret += "CREATE TABLE `" + name + "` (";
return toret;
}
public static string GetPrefix(Type type)
{
string toret = "";
if (type == typeof(string)) toret = "'";
return toret;
}
public static string InsterInto(string table, DataColumnCollection columns)
{
string to ="";
to += "INSERT INTO `" + table + "` (";
for (int i = 0; i < columns.Count; i++)
{
to += "`" + columns[i].Caption + "`";
if (i + 1 != columns.Count) to += ",";
}
to += ") VALUES \r\n";
return to;
}
}
}
Denke es ist offensichtlich... zum einen macht er " statt ' ..
Aber hier mal ein Converter der paar Jahre alt ist von einem mysql Projekt..
Habe auch irgendwo einen mssql Converter, aber auf die schnelle ka wo der liegt.
|
|
|
04/13/2017, 00:18
|
#7
|
elite*gold: 0
Join Date: Sep 2013
Posts: 562
Received Thanks: 361
|
Wenn du mal 1zu1 meinen code übernimmst solltest du 0 fehler haben.
Versuch ausserdem mal anstatt
Code:
INSERT INTO dItemInfo (ID,InxName,Name,Type,Class,MaxLot,Equip,ItemAuctionGroup,TwoHand,AtkSpeed,DemandLv,Grade,MinWC,MaxWC,AC,MinMA,MaxMA,MR,WCRate,MARate,ACRate,MRRate,CriRate,CriMinWc,CriMaxWc,CriMinMa,CriMaxMa,CrlTB,MaxHP,MaxSP,MaxAP,WhoEquip,BuyPrice,SellPrice,BuyFame,BuyGToken,BuyGBCoin,WeaponType,ArmorType,UpLimit,UpSucRatio,UpLuckRatio,UpResource,BasicUpInx,AddUpInx,TH,TB,ShieldAC,HitRatePlus,EvaRatePlus,MACriPlus,CriDamPlus,MagCriDamPlus,BT_Inx,TitleName,ItemGradeType,ItemUseSkill,SetItemIndex,ItemFunc,AutoMon) VALUES
(0,"LeatherBoots","Leather Boots",0,8,1,21,19,0,1000,2,1,0,0,2,0,0,0,1000,1000,1000,1000,0,0,0,0,0,0,0,0,0,62,13,2,0,0,0,0,1,9,0,0,0,60,0,0,1,0,0,0,0,0,0,0,"-",2,"-","-",0,0),
es in
Code:
INSERT INTO dbo.dItemInfo (ID,InxName,Name,Type,Class,MaxLot,Equip,ItemAuctionGroup,TwoHand,AtkSpeed,DemandLv,Grade,MinWC,MaxWC,AC,MinMA,MaxMA,MR,WCRate,MARate,ACRate,MRRate,CriRate,CriMinWc,CriMaxWc,CriMinMa,CriMaxMa,CrlTB,MaxHP,MaxSP,MaxAP,WhoEquip,BuyPrice,SellPrice,BuyFame,BuyGToken,BuyGBCoin,WeaponType,ArmorType,UpLimit,UpSucRatio,UpLuckRatio,UpResource,BasicUpInx,AddUpInx,TH,TB,ShieldAC,HitRatePlus,EvaRatePlus,MACriPlus,CriDamPlus,MagCriDamPlus,BT_Inx,TitleName,ItemGradeType,ItemUseSkill,SetItemIndex,ItemFunc,AutoMon) VALUES
(0,'LeatherBoots','Leather Boots',0,8,1,21,19,0,1000,2,1,0,0,2,0,0,0,1000,1000,1000,1000,0,0,0,0,0,0,0,0,0,62,13,2,0,0,0,0,1,9,0,0,0,60,0,0,1,0,0,0,0,0,0,0,'-',2,'-','-',0,0)
zu ändern
die tabelle dItemInfo muss natürlich auch vorher angelegt sein jedoch sagt dein fehler aus, dass keine Spalte namens LeatherBoots existiert, was steht sonst noch in deinem Query?
Bitte alles bis zum (inklusive des) ersten "INSERT" Posten
Quote:
Originally Posted by EpicFight
Wahrscheinlich nutzt du den SHN Editor von MrFr irgendwas, da ist der Source Code ja so:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace SHNDecrypt
{
public class SQLConv
{
public static string GetSQLType(Type type)
{
if (type == typeof(byte))
{
return "TINYINT(1)";
}
else if(type == typeof(SByte)){
return "TINYINT(1) UNSIGNED";
}
else if (type == typeof(UInt32))
{
return "INT(11) UNSIGNED";
}
else if (type == typeof(ushort))
{
return "SMALLINT(5) UNSIGNED";
}
else if (type == typeof(Single))
{
return "FLOAT(10)";
}
else if (type == typeof(Int16))
{
return "SMALLINT(5)";
}
else if (type == typeof(Int32))
{
return "INT(11)";
}
else
{
return "TEXT";
}
}
public static string CreateHeader(string name, bool drop)
{
string toret = "";
if(drop) toret += "DROP TABLE IF EXISTS `" + name + "`;\r\n";
toret += "CREATE TABLE `" + name + "` (";
return toret;
}
public static string GetPrefix(Type type)
{
string toret = "";
if (type == typeof(string)) toret = "'";
return toret;
}
public static string InsterInto(string table, DataColumnCollection columns)
{
string to ="";
to += "INSERT INTO `" + table + "` (";
for (int i = 0; i < columns.Count; i++)
{
to += "`" + columns[i].Caption + "`";
if (i + 1 != columns.Count) to += ",";
}
to += ") VALUES \r\n";
return to;
}
}
}
Denke es ist offensichtlich... zum einen macht er " statt ' ..
Aber hier mal ein Converter der paar Jahre alt ist von einem mysql Projekt..
Habe auch irgendwo einen mssql Converter, aber auf die schnelle ka wo der liegt.
|
p.s. vermutlich liegt der hier:
Problem dabei, meistens beziehen sich Online converter ebenso auf aktuelle Versionen.
|
|
|
Similar Threads
|
[Release][Query] Query _InvCOS Items WITH _Char Connection
12/29/2015 - SRO PServer Guides & Releases - 1 Replies
Ok, so i needed to write this query for a procedure im working on and not many people know how to connect the pet inventory table to the character table.... so this query will explain how its done...
im not going to explain every single detail, like how there is no charcos when pet is despawned / dead... but yea you can probably figure that all out from this query...
The code...
USE
SELECT pet_invo.
,pet_invo. PetSlot
|
[Suche]Query für "Alteklinge, Reichsklinge" &' Stichdolche NUR QUERY!
08/18/2010 - Metin2 Private Server - 1 Replies
Ich weiß ich werd nervig aber ich suche die Query's
für Alteklinge, Reichsklinge &' Strichdolche
Why?
Naya, weil ich in der DB i-wie nur Drachenmaulglocke hab
... not more -.-
Auf jeden Fall Icon's etc. etc. etc. hab ich ich brauche nur die Query's
|
All times are GMT +1. The time now is 06:22.
|
|