Forum Replies Created

Viewing 15 posts - 241 through 255 (of 1,034 total)

  • RE: BIT Conversions

    Good back to basics question... I'm glad I had my morning coffee first or I would have missed the 1/True bit. 🙂

  • RE: DATEADD function

    You know you're starting to get paranoid when you're always looking for the catch.

    Glad that I couldn't find one and got it correct 🙂

  • RE: PersonID with Max(Version) from it...

    info 58414 (8/9/2012)


    Hi,

    how can I get effectively max(version) to identify any PersonID with multiple VersionID?

    That's what GROUP BY and MAX are for 🙂

    DECLARE @persons TABLE(

    personid INT,

    version INT)

    INSERT @persons

    VALUES(1,1),(1,2),(1,3),(2,1),(2,2),(3,1),(4,1),(4,2)

    SELECT

    personid,

    maxversion = MAX(version)

    FROM...

  • RE: ISNULL

    Koen Verbeeck (8/8/2012)


    Spent 15 minutes looking for the gotcha... (what do you want, after yesterday's question)

    😀

    /agree I was starting to get paranoid.... finally gave up and went with my...

  • RE: What is the performance bottleneck here?

    MyDoggieJessie (8/7/2012)


    All jokes aside 😉 when removing the index hint the optimizer automatically turns it into an index scan...so that's why I was trying to force it to use the...

  • RE: Query Help- Cursor change into FOR WHILE LOOP, TEMP TABLE

    Ok, next time I will remind myself to read the dates on messages in here... at least one response to something that was already handled last month. Oops 🙂

  • RE: Commenting in Dynamic query

    Luis Cazares (8/7/2012)


    But it does matter if we're talking about number of rows returned.

    With select * you can get either 1 or 0 (in this particular case).

    With select COUNT(*) you'll...

  • RE: Query Help- Cursor change into FOR WHILE LOOP, TEMP TABLE

    Lynn Pettis (8/1/2012)


    morepainot (8/1/2012)


    Ok, I took care of those errors. Now the only errors I am getting are

    "Msg 2714, Level 16, State 3, Procedure usp_PreStageValidation, Line 185

    There is already...

  • RE: Query Help- Cursor change into FOR WHILE LOOP, TEMP TABLE

    Jeff Moden (7/26/2012)


    Sean Lange (7/26/2012)


    @jeff - You need start the official anti-RBAR alliance and offer membership to those who have proven to be members. We could have a secret handshake...

  • RE: Query Help- Cursor change into FOR WHILE LOOP, TEMP TABLE

    manub22 (7/26/2012)


    Lot of problems can be easily done by SET based approach rather than using CURSORS. People not expert in writing SQL queries and/or not aware of new features end...

  • RE: Commenting in Dynamic query

    Luis Cazares (8/7/2012)


    SQLRNNR (8/7/2012)


    As far as I remember, the "Select count(*)" was changed by Steve after the discussion on the previous question and originally had a "Select *".

    However, I don't...

  • RE: common table expressions

    I'm like Jeff.

    I use CTE's to move subqueries to the top so I can treat them as the proper named derived tables that they are.

    I also use them when I...

  • RE: IN Clause Question

    Must agree with Sean and Dwain.

    Either pass in separated values and split the strings to a temporary table/table variable and join to that, or if you feel comfortable pass in...

  • RE: Can a table have two primary keys?

    Could be a test question.

    A decade ago when I taught Database Theory, my tests were take home week long projects.

    25 T/F

    25 Multiple Choice

    25 Fill in the blank

    25 point Essay question.

    During...

  • RE: Master-detail reporting question

    declare @ProductLine table

    (ProductlineID int)

    declare @Products table

    (ProductLineID int,

    ProductID int,

    Status int)

    insert into @ProductLine values (1)

    Insert into @ProductLine values (2)

    Insert into @ProductLine values (3)

    Insert into @ProductLine values...

Viewing 15 posts - 241 through 255 (of 1,034 total)