Viewing 15 posts - 76 through 90 (of 223 total)
Cool, you found a workaround!! π I'm glad that it was helpful. This is a very fast way to convert csv to rows. Have fun.
- arjun
September 5, 2011 at 10:20 pm
declare @colname varchar(100)
Set @colname = 'a1,a2,a3,b1,b2,a1'
set @colname = '<R><N>' + replace(@colname,',','</N><N>') + '</N></R>'
declare @xml xml = (select cast(@colname as xml))
--use this if you want colnames as separate rows
;with cte as
(
select...
September 5, 2011 at 7:52 am
Me neither, I have a crucial update SP in which a lot of action happens. One set of updates here uses MERGE. It works well for up to 50 records....
August 30, 2011 at 4:21 am
Cursor is not always the best way to solve a problem. Read up on cons of using a cursor.
Do post some data scripts the next time. And it is columns...
August 30, 2011 at 4:08 am
Another option is to use the HierarchyID data type introduced in 2008. Following is a set of scripts which might help you. I had adapted that from an internet resource...
August 24, 2011 at 6:47 am
This was a very weird problem. I got the execution time from ~10 min to ~10 secs by making one change.
@searchcriteria -
'<SearchCriteria><Blah>Blah</Blah><Assignee>adam</Assignee></SearchCriteria>'
join (SELECT c.value('(.)[1]', 'varchar(30)') [usercode] FROM @searchcriteria.nodes('//Assignee')tab(c)) SA
on...
August 24, 2011 at 5:56 am
select 1 from dbo.tally T
where E.employee_id = 1
But!!
select 1 from dbo.tally T
join dbo.Employee E
on E.employeeid = T.num and T.num = 1
It works!!
Well, it's a bad example but I hope you...
August 22, 2011 at 9:34 am
Ya, my bad. My script won't work. I went by the test data.
- arjun
May 23, 2011 at 8:47 am
Ninja's_RGR'us (5/19/2011)
Any special way to make your trick work when there are negatives numbers too?
use tempdb
go
if(object_id('tempdb..#test') is null) create table #test(ver varchar(50))
truncate table #test
insert into #test(ver)
values
('10.00.1600'),
('10.00.1763'),
('10.00.1779'),
('10.00.1787'),
('10.00.1798'),
('10.00.1806'),
('10.00.1812'),
('10.00.1818'),
('10.00.1823'),
('9.00.4315'),
('9.00.4317'),
('9.00.4325'),
('9.00.5000'),
('9.00.5254'),
('9.00.5259'),
('9.00.5266')
select * from #test
order by...
May 23, 2011 at 6:30 am
mthurber (5/4/2011)
May 4, 2011 at 3:24 pm
Can you please post the sample data? Something like the following:
col1 | col2
----------
1 | ab
2 | cd
- arjun
May 4, 2011 at 6:27 am
Hi Usha, this information is not sufficient.
As of now, you have mentioned -
1. The output you need.
2. The output you are getting.
3. The SP which acts as the...
May 4, 2011 at 5:39 am
Viewing 15 posts - 76 through 90 (of 223 total)