Forum Replies Created

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

  • RE: Index Selection in SQL Server

    GilaMonster (2/27/2013)


    In this case it's simply the smallest index that can be used to satisfy the query.

    Selection has to do with which index can filter the largest number of the...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Catch Data between symbols in SQL

    dwain.c (2/8/2013)


    vinu512 (2/7/2013)


    I worked it out. This is the query that would get you the results you want:

    --Creating Table

    Create Table Ex1

    (

    Id Int Identity(1,1),

    AllLevels Varchar(MAX)

    )

    --Inserting...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Catch Data between symbols in SQL

    hi Chris, it definitely runs like a Rocket. It would be really nice if you could explain the following code :

    SELECT df = LEFT(b.AllLevels, CHARINDEX('ยป',b.AllLevels,1)-1)

    UNION ALL

    SELECT df = SUBSTRING(b.AllLevels,N+1,...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Staging table population - advice needed

    demonfox (2/7/2013)


    Abu Dina (2/7/2013)


    Fair enough. I think I'm trying to be too clever when I should be concentrating on getting the rest of the project done first! This part works...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Query and Result

    anthony.green (2/7/2013)


    Your sample data doesnt match the output, we need the output to be based on your sample data, so either change the data or change the output to match.

    +1

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Query and Result

    Please post the result set that is expected from the above data.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: PIVOT -all columns will be null..how to solve?

    I hope this is what you require from the above data:

    Declare @sql As Varchar(MAX)

    Select @sql = 'Select paymentID, ' + STUFF((Select Distinct ',SUM(Case When Reason = ' +...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Staging table population - advice needed

    So if the incoming data doesn't have a forename then what do you insert into the table??..Do you Insert NULL??....

    I think you should read upon Coalesce.

    If you still cant...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Catch Data between symbols in SQL

    Even Better.......if you create a Non Clustered index On the Tally table then you get the results even fatser.

    Create NonClustered Index NCLIX_Tally On Tally(n)

    Select Id,

    ...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Catch Data between symbols in SQL

    You can switch the Cross Apply in the query with an Outer Apply, that would reduce the time by more than 70%, as follows :

    Select Id,

    ...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Catch Data between symbols in SQL

    I worked it out. This is the query that would get you the results you want:

    --Creating Table

    Create Table Ex1

    (

    Id Int Identity(1,1),

    AllLevels Varchar(MAX)

    )

    --Inserting Sample Data...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: I need a plan to cleans all the tables in a database for every 9 months.

    m.rajesh.uk (2/6/2013)


    cleans all the tables in a database

    What do you mean by cleaning tables??

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: How to update on condition based?

    You can't do that using the case.....The case would perform the Update operation. To avoid the Update as a whole you need to wrap the Update statement in an If...Then....

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Stuck with PIVOT

    All the above methods would get you the required data. This is just an extension to them.

    Incase you have more than three attribute Types which may change, then you can...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

  • RE: Clock-In/ Clock-Out

    I tried the query on random sample data consisting of 1164000 rows.

    Dwain, your query is the clear winner. Here are the results for all the three queries :

    Dwain's...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] ๐Ÿ˜‰

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