Forum Replies Created

Viewing 15 posts - 4,006 through 4,020 (of 5,502 total)

  • RE: Need help parsing a string in a T-SQL query.

    Assuming the string pattern at the end of the string needs to be identical to a pattern in the first half of the string, the sample code might work:

    DECLARE @col...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Error with dynamic SQL

    Why would you use a cursor in the first place?

    Build a dynamic SQL string and run your update all in one. Something like the following (untested)

    DECLARE @sql VARCHAR(1000)

    SET @sql=

    'INSERT INTO...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Update a Flag Ten Minutes from Now

    Another option would be using a computed column.

    However, since this cannot be used as persisted column (getdate() is non-deterministic) and cannot be indexed either, the column will be recalculated every...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Need help to insert XML Data into 2 tables

    unfortunately, neither your sample data nor any description did point to that... :ermm:

    You might want to look into using the OUTPUT in your first insert statement to capture the id...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Personnel assignment based on seniority

    Please provide table def, some sample and expected result as described in the first link in my signature. It would help us help you.

    The task itself sounds like a pretty...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Need help to insert XML Data into 2 tables

    My first advice is to get rid of the custom data type.

    It won't add any value to your code or database structure. Instead it will cause pain to maintain it....



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Need help parsing a string in a T-SQL query.

    It would be a lot easier if you'd consider storing the separate logical information in separate columns. There are many scenarios to be covered to make a string parsing like...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: t-sql help

    Well, then you'd just have to create your own serialized number using ROW_NUMBER.

    Based on Lynns sample data it would look like

    ;WITH cte AS

    (

    SELECT

    ROW_NUMBER() OVER(ORDER BY StartTime) AS ROW,

    ...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: where clause need to pull datetime column for yesterday at 3:00 pm to current time

    The following sample will add 15 hours to the day before today ( GETDATE()-1 ), normalized to the beginning of the day using a common dateadd/datediff routine.

    DECLARE @yesterday DATETIME

    SET @yesterday...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Concatentate nvarchar(1024) field for text mining

    I am still a layman as far as full-text search is concerned for text mining.

    It depends on how you want to deal with your data. Or, in other words: what's...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: t-sql help

    To meet the requirement

    ...create a stored procedure to which I will be passing in table1 and table2 as parameters,...

    Pauls query need to be changed into dynamic SQL, I guess:

    DECLARE...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: count(uniqueidentifier data type field)

    I don't have an answer why you cannot use a COUNT function on a uniqueidentifier data type.

    But considering it's the primary key I'd say COUNT(*) would work as a substitute,...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Concatentate nvarchar(1024) field for text mining

    anish_ns (3/9/2010)


    ...

    Now, we want to so some text mining on the data. So, I would like to create a text file for each unique sessionID with all associated text data....



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Import XML data

    Doesn't look like a valid xml to me... Where are the closing tags for the various "field name" tags? And what would be your expected result?

    Btw: whoever came up with...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Are the posted questions getting worse?

    St. Lynn, OTD (Owner of the Tent in the Desert), HHG (Hula-Hippo-Guard)



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 4,006 through 4,020 (of 5,502 total)