Forum Replies Created

Viewing 15 posts - 1,351 through 1,365 (of 2,452 total)

  • RE: loop and query CSV files in a folder using union all query to form resultant table on server

    sifar786 (7/6/2014)


    Thanks for the links mate. 🙂

    BTW, i am currently looking at this Cube Tutorial. But it doesnt explain how to create and deploy cubes made from a single table....

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: loop and query CSV files in a folder using union all query to form resultant table on server

    sifar786 (7/5/2014)


    the above queries work fine in sql server now, but donot know how to automate job schedule to scan network folder for csv files and run those queries on...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: loop and query CSV files in a folder using union all query to form resultant table on server

    is this correct....

    UNION ALL

    SELECT t.*, (substring(t.[week],3,4))*1 as iYEAR,

    ''SPAIN'' as [sCOUNTRY], ''EURO'' as [sCHAR],

    IIf( t2.first_week_on_sale = 1 and t2.weeks_on_sale <=52,

    ((((substring(t.[week],3,4) - 2011) * 52) + right(t.[week],2)) - t2.first_week_on_sale) + (1...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: loop and query CSV files in a folder using union all query to form resultant table on server

    I am trying to run a UNION ALL query in SQL SERVER 2014 on multiple large CSV files - the result of which i want to get into a table...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Generate column numbers using dynamic SQL and pivot command

    sifar786 (7/4/2014)


    Hi,

    sure.

    Is it possible to send it to you privately to a personal email address?

    no probs...send me a PM ....if I get anywhere I'll obfuscate the details for you if...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Generate column numbers using dynamic SQL and pivot command

    can you provide some sample data in a readily consumable format for DATABASE_SPAIN_EURO.CSV/DATABASE_FRANCE_EURO.CSV ?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculating average

    do you have the data before it was pivoted/crosstabbed?

    eg

    emp1,jan,200

    emp1,feb,220

    emp2,jan,300

    emp2,mar,305

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Order of IN operator

    just a thought and maybe provide flexibility if you require....

    IF OBJECT_ID('tempdb..sort') IS NOT NULL DROP TABLE sort;

    CREATE TABLE #sort

    (sortID int not null,

    sortvalue int not null);

    INSERT #sort VALUES (1, 2323),(2, 1236),(3,...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Optimize SQL

    Lynn Pettis (7/3/2014)


    J Livingston SQL (7/3/2014)


    .

    I agree. With 3,250,325 rows in the main table mine ran in about 3 seconds.

    what spec hardware you running Lynn.....?[/quote]

    Dell M4600 laptop, dual CORE...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Generate column numbers using dynamic SQL and pivot command

    if you have little time to prepare this report and you have never used SSAS...then this might not be the right time to start SSAS

    maybe if you provided some data...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Optimize SQL

    .[/quote]

    I agree. With 3,250,325 rows in the main table mine ran in about 3 seconds.

    [/quote]

    what spec hardware you running Lynn.....?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Optimize SQL

    Arno Ho (7/3/2014)


    Hi,

    Thank you for all your answers and proposed solutions

    I applied that Lynn

    With my method it takes 15 minutes and 12 minutes with the Lynn solution

    I think I'll...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Generate column numbers using dynamic SQL and pivot command

    in my opinion I think what you are trying to do from excel is potentially flawed....you say that you have over 100M rows to analyse.

    if you can create the necessary...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Generate column numbers using dynamic SQL and pivot command

    sifar786 (7/2/2014)


    All i want to do is call this sp from excel passing it 2 parameters viz., @country & @kpi so that it returns me the pivoted data into excel.

    on...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Help on PIVOT Query

    Luis Cazares (7/2/2014)


    There's no need to read the table trice.

    WITH CTE AS(

    SELECT ID,

    Orderamt,

    ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 1,351 through 1,365 (of 2,452 total)