Forum Replies Created

Viewing 15 posts - 76 through 90 (of 223 total)

  • RE: Could you please help me take a look at the sql query

    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

  • RE: Query doing most IO and longest elapsed time

    Dream on.

  • RE: Could you please help me take a look at the sql query

    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...

  • RE: Convert Rows Into Column

    I don't work on Saturday and Sunday πŸ˜‰

  • RE: Merge operator and transactional replication

    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....

  • RE: Convert Rows Into Column

    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...

  • RE: Need Query Help....

    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...

  • RE: Recursive CTE with WHERE clause

    No problem Neil; glad I could help.

  • RE: SP with dynamic query running slow; the same dynamic query runs fast separately

    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...

  • RE: Recursive CTE with WHERE clause

    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...

  • RE: Order varchar numericly

    Ya, my bad. My script won't work. I went by the test data.

    - arjun

  • RE: Order varchar numericly

    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...

  • RE: Primary key and Foreign key on same column

    mthurber (5/4/2011)


    It’s fairly common to have a Primary Key and a Foreign Key on the same column, when the Foreign Key points to a different table. Example: a company...

  • RE: sql count

    Can you please post the sample data? Something like the following:

    col1 | col2

    ----------

    1 | ab

    2 | cd

    - arjun

  • RE: sql count

    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...

Viewing 15 posts - 76 through 90 (of 223 total)