newbieHQ's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
76 (0.06 per day)
Joined:
20-January 11
Profile Views:
2,203
Last Active:
User is offline Jul 23 2012 07:50 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
BMW
Dream Kudos:
0
Icon   newbieHQ has not set their status

Posts I've Made

  1. In Topic: cant insert data from temporary table

    Posted 22 Apr 2012

    everything are working fine now even without using store procedure and just run the queries in string format...if i am not using store procedure...i cant fit in all the queries into the vb.net script there so i have to call store procedure to processes the data for me ... eventually the store procedure execute successfully but the table- haha does not shows any data inside it..and i have to manually 'highlight' the queries then everything only can work and data only inserted inside the data............ else nothing gonna happen on the table and remain empty .... haiz.....wat am i missing here actually ? @@
  2. In Topic: cant insert data from temporary table

    Posted 22 Apr 2012

    yup ..it works all the time ... i have been testing on it before this...and also after added the insert statement there but i cant fit all the sql queries into the vb script there... store procedure will be the best way for me to process the data right ?
    the test4.txt is exist and in 'C:\test4.txt'...
    once the store procedure successfully run completed ... there are no data inside the table (hehe) after insert sql processed... wat am i missing here actually ?
  3. In Topic: cant insert data from temporary table

    Posted 22 Apr 2012

    hi everyone ..i have been chaging my code to dynamically sql ..below is the code.. i am trying to compare the existing data with temporary table data in order to prevent the duplicated data happen by using SQL - except ... after that i will insert the data produced after comparison to particular table which is haha .. the whole store procedure successfully run but why i dont get any result from table haha...and the table is still empty ..what am i mising here actually ? thank you everyone ..
    create table #temptbl
    (
    productbatch varchar(50),
    batchno varchar(50),
    date varchar(50),
    time varchar(50),
    mixingtime varchar (50),
    FB10 numeric(8,2),
    FB11 numeric(8,2), 
    FB12 numeric(8,2),
    FB13 numeric(8,2),
    FB14 numeric(8,2),
    FB15 numeric(8,2),
    FB16 numeric(8,2),
    FB17 numeric(8,2),
    FB18 numeric(8,2),
    FB19 numeric(8,2),
    N1 numeric(8,2),
    F817 numeric(8,2),
    F818 numeric(8,2),
    F819 numeric(8,2),
    FB23 numeric(8,2)
    );
    
    declare @path varchar (2000);
    declare @sql varchar (2000);
    declare @sql2 varchar (2000);
    select @path = 'c:\test5.txt';
    set @sql = 'bulk insert #temptbl from ''' + @path +''' with ( fieldterminator = ''\t'',rowterminator = ''\t\n'') ' ;
    
    
    print @sql;
    exec (@sql);
    
    set @sql2 = 'insert into haha (productbatch,date,batchno,time)
    select * from (
    SELECT dailyfbsr.productbatch, DailyFBSR.date, DailyFBSR.batchno, DailyFBSR.time
    FROM dailyfbsr
    except 
    SELECT #temptbl.productbatch, #temptbl.date, #temptbl.batchno, #temptbl.time
    FROM #temptbl
    )
    as #nghangkuan';
    exec (@sql2);
    
    drop table #temptbl;
    
    


    1 thing i am curious and feeling weird is if i manually select the whole sql syntax above...the sql program manage to insert the data to haha table but why when i execute the whole procedure ... it return nothing on the table - haha .. and the table is empty ... :(

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Programming Languages:
php

Contact Information

E-mail:
Private
AIM:
AIM  pro programmer

Comments

newbieHQ has no profile comments yet. Why not say hello?