Forum Replies Created

Viewing 15 posts - 481 through 495 (of 5,502 total)

  • RE: can any one just help help me to just avoid comma at end trim for this scalar function?

    I would also avoid the four round trips to tblAdContactInfo:

    ;

    WITH cte AS

    (

    SELECT [Value],ContactTypeId

    FROM tblAdContactInfo

    WHERE AdInfoId=@AdInfoId AND ContactTypeId IN (5,6,7,8)

    )

    Select

    @Building= MAX(CASE WHEN ContactTypeId = 5 THEN [Value] ELSE NULL...



    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: Query SQL Log to find errors

    Given the table structure you posted there's no way to find the rows that should match.

    Let's assume there are four rows, all having the same values for Server,LogDate,ProcessInfo.

    How would you...



    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: Query SQL Log to find errors

    Without knowing the table structure it's hard to tell what needs to be changee in the code snippet I provided.

    I'm sure it can be modified to meet your criteria.



    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: Query SQL Log to find errors

    Theory first:

    In a table, there is no natural "above" or "below". It all depends on the ORDER BY criteria.

    Ok, end of theory. Unfortunately, the wErrorLog table in the link you...



    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: Data migration

    The examples you mentioned usually refer to data transfer or database recovery.

    Data migration usually involves two different systems (e.g. two different SQL server versions or to migrate from Oracle to...



    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: inserting to primary table and secondary table at the same time

    It's a rather vague description o what you're trying to do. So the answer will be vague, too:

    You could use the OUTPUT clause together with the first statement to capture...



    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: Getting Most Recent Date

    Here are some resources for cte:

    BooksOnLine and a article[/url] here at SSC.

    and ROW_NUMBER

    BooksOnLine and a related article



    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: Getting Most Recent Date

    Did you try the code I posted?



    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: Getting Most Recent Date

    I'm not sure if my approach is waht you're lloking for, but I think the ROW_NUMBER approach will help here:

    ;

    WITH cte AS

    (

    SELECT

    Student_ID,

    Exam_ID,

    Admission_Exam_Code,

    Admission_Exam,

    Admission_Exam_Type,

    Admission_Exam_Date,

    Admission_Exam_Score,

    ROW_NUMBER() OVER(PARTITION BY Student_ID,Exam_ID ORDER BY Admission_Exam_Date desc...



    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: How to find out what is actually in use

    To expand on what Gail already recommended:

    Even though there might be objects that never show up you'll need to investigate the purpose of each of those objects. Some might be...



    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: how to find no of row and column from a table?

    Is this still the same issue as the one you posted a few days ago?



    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: Help needed transforming source table to result table; DDL attached

    Something like this?

    SELECT

    t1.col_1 AS col_1a,

    t2.col_1 AS col_1b

    FROM SourceTbl t1

    INNER JOIN SourceTbl t2

    ON t1.col_2=t2.col_2

    AND t1.col_3=t2.col_3

    AND t1.col_1<>t2.col_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: proc for HTML sp_send_dbmail multi-recipient, multi-row?

    Are you looking for something like the following code snippet?

    I decided to use a solution that is based on a given @Fname parameter.

    I would wrap this code in a separate...



    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?

    GabyYYZ (3/15/2012)


    ...

    My boss, whose background is SAP and Oracle, loves asking the referential integrity questions,...

    I'm just wondering if he's interested in learning this stuff since he's been missing 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: Appendix B: Suppress namespace attributes in nested SELECT FOR XML

    Why not create the xml structure without the namespace reference, but with the nil element and replace < sourcename > with < sourcename xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > and nil="true" with "xsi:nil="true" ?

    Edit:...



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