Viewing 6 posts - 16 through 21 (of 21 total)
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
January 18, 2011 at 9:50 am
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...
November 30, 2010 at 8:43 am
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...
November 30, 2010 at 7:13 am
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...
November 30, 2010 at 7:00 am
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...
November 30, 2010 at 6:28 am
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
November 30, 2010 at 5:19 am
Viewing 6 posts - 16 through 21 (of 21 total)