Forum Replies Created

Viewing 6 posts - 16 through 21 (of 21 total)

  • RE: avg calculation

    try this

    select id, avg(sal) from @temp

    where sal <> 0

    group by id

    having count(reportingperiod) = 2

    declare variable to store reportingperiod. in above example i have used constant 2

  • RE: How to know which join will be used first & so on?

    Statement like you shown is not showing any cascading join. By cascading join i means A --> B --> C. If cascading join is used it will be processed by...

  • RE: CSV Import Problem

    Jeff,

    The method i can straight away suggest is to use SSIS.

    1. Create in-memory single column table with each csv row as table row

    2. find COMMA's between "xxxx,yyyy"

    3. replace with...

  • RE: Assign Group ID To Rows

    cimbom_kid

    in that case you can add another update statment which will change group_ID based on creteria previously inserted group header

    CREATE TABLE #TMP_LOADER_2 (

    group_id int IDENTITY (1, 1)

    ,linenum int)

    insert into #TMP_LOADER_2

    select...

  • RE: Assign Group ID To Rows

    Try this one:

    CREATE TABLE #TMP_LOADER_2 (

    group_id int IDENTITY (1, 1)

    ,linenum int)

    insert into #TMP_LOADER_2

    select linenum from #TMP_LOADER where fileline = '-----'

    UPDATE t1

    SET t1.group_id = t2.group_id

    FROM #TMP_LOADER t1 inner join #TMP_LOADER_2...

  • RE: CSV Import Problem

    i had same issue where we use to import CSV files. Best option i would recommend is first clean up your CSV by removing columns with internal COMMA's

    Good luck

Viewing 6 posts - 16 through 21 (of 21 total)