Forum Replies Created

Viewing 15 posts - 31 through 45 (of 5,502 total)

  • RE: Character String and Wild Card help

    Change the statement for @vPatientFirstName to

    SELECT @vPatientFirstName = (RIGHT((@PatientSearch), LEN(@PatientSearch) - charindex(',', (@PatientSearch)) -1))



    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: Initialize sp parameter using a select statement

    maieras.andrei (12/22/2014)


    I think a solution without hard coding or using a 'select count(*)' statement or a 'if clause' doesn't exist??

    I mean if @top parameter is passed return the @top rows...



    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: XML to Table

    What did you try so far?

    Please show us your current query and where you get stuck.



    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: delete user of db in sql server

    duplicate post. No replies please.

    Original post: here



    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: Initialize sp parameter using a select statement

    Option 1:

    IF @Top IS NULL

    BEGIN

    SELECT @Top = SUM(pa.rows) RowCnt

    FROM sys.partitions pa

    WHERE pa.OBJECT_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: Get ID from look up table based on value passed to function

    I would add a computed persisted indexed column that holds the "summary" of all values, preferred in a shorter form, e.g. just the first character (either based on the value...



    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: Performance issue with subquery containing row_number and partitioning

    I'd rather use the APPLY operator:

    SELECT Equipment.EquipID, x.EquipmentAmount

    FROM Equipment

    OUTER APPLY

    (

    SELECT TOP 1 InvoiceEquipment.Amount AS 'EquipmentAmount'

    FROM InvoiceEquipment

    WHERE InvoiceEquipment.Type = 'A' AND InvoiceEquipment.EquipID = Equipment.EquipID

    ORDER BY InvoiceEquipment.InvoiceDate DESC

    )x

    From my point of view...



    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?

    spaghettidba (10/21/2014)


    Ed Wagner (10/21/2014)


    Parma, Venice...these cities are making me think of authentic Italian food. I cook and am a HUGE fan of real Italian, so now I'm hungry. ...



    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: Excel Document as attachment via dbmail

    Try the following:

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'nationstar University',

    @recipients = 'donald@nation.com',

    @query = 'select FNAME,LNAME from PED.dbo.TD_EmployeeProfile_FinalV2 where manager_number=100000491' ,

    @subject = 'Test email',

    @attach_query_result_as_file = 1,

    @query_attachment_filename='filename.xls',

    @query_result_separator='' -- tab

    I'm using this configuration quite frequently 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: Excel Document as attachment via dbmail

    What do you mean by "distorted"?

    Can you provide some sample data that will return "distorted"?



    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: With & Without Nested Loops (inner join) for Select statement which is the more performance?

    Step 1: If you need to have the exact number for count(id) for both queries, remove the NOLOCK hint. Search for "NOLOCK dirty reads" for details. Otherwise it's just an...



    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: UNION followed by IF ELSE

    I recommend to assign the result of the query against Huizen in a separate variable and use that result in the query to eliminate the IF .. ELSE control flow.

    SELECT...



    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: Upgrading from SQL 2012 Standard Edition Server + CAL license to Standard edition Core based License

    @SQLFRNDZ (10/10/2014)


    You do not need to uninstall or re-install, when you do a true-up or new agreement you just tell them how many cores you have on sql box, if...



    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?

    Steve Jones - SSC Editor (10/2/2014)


    Dev Updates:

    Top priority for the IT team, which manages dev, is reducing SPAM. They are looking at integrating with ASKIMET for rating comments, but I've...



    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: Problems with retrieving all the records from tables

    The query looks valid.

    Please provide table def and sample data together with your expected result based on the sample data provided.

    Otherwise we'd just be guessing here...



    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 - 31 through 45 (of 5,502 total)