Request| Lines

05/31/2012 10:23 CrystalCoder#1
i almost finish with jsro server files they state on 98% working
i just need to extract from characterdata.txt of jsro
the part of refobjchar.
if someone know a good way to do it , i be glad to hear.
05/31/2012 10:38 IceAmStiel#2
Either bulk insert + drop column or bulk insert + insert into select *

Since the chardata contains pretty many columns I recommend you to use dynamic sql to create your table for to bulk insert
05/31/2012 10:46 CrystalCoder#3
allright but also the link from refobjcommon need to be at id in refobjchar
soo can you give ex what you mean?
05/31/2012 10:49 IceAmStiel#4
PHP Code:
Declare @ColumnAmount tinyint 64

Declare
        @
CurColumn tinyint 1
        @
CreateTable varchar(max) = 'CREATE TABLE _ChardataBulk ( ';

WHILE (@
CurColumn <= @ColumnAmount)
    
BEGIN
        SET 
@CreateTable += ' Column'+CONVERT(varchar(2),@CurColumn)+' varchar(max) NULL, '
        
SET @CurColumn += 1
    END

SET 
@CreateTable LEFT(@CreateTable,LEN(@CreateTable)-1) + ')'     
EXEC (@CreateTable)

SELECT FROM _ChardataBulk

DROP TABLE _ChardataBulk 
--> Table with 64 Columns


EDIT:

Actually you could also recreate _RefObjCommon+_RefObjChar w/o the columns which the chardata doesn't contain..

Right Click on the Table -> Script Table as -> Create To -> New Query Editor Window
(for _RefObjCommon as well as _RefObjItem, naturally to one table with a different name, to have the right column datatypes)

(SQL '08)
05/31/2012 11:19 CrystalCoder#5
read pm.
06/01/2012 11:58 Janick_#6
Use microsoft excel, it can do everything you want, it also can create numbers that increase by 1 every line for the id's