Forum Replies Created

Viewing 15 posts - 46 through 60 (of 65 total)

  • RE: SELECT INTO

    UMG Developer (6/13/2010)


    I got it wrong because I didn't read the question correctly, I thought it was asking how many rows where returned.

    Damn! Same here!!!!!

  • RE: AND & OR

    Absolutely ridiculous!

    What is the point of a trick question on a technical forum?

    Maybe you could argue that as developers we need to pay attention to the smallest detail, but that's...

  • RE: UPDATE

    beck.patrick (9/24/2009)


    So the (corrected) example code

    update

    a1

    set

    col = a2.col

    from

    table1 as a1,

    table2 as a2

    where

    a1.col = a2.col

    This will update table1.col to with the...

  • RE: @@DBTS

    Me too... never occurred to me I could choose multiple items.

  • RE: T-SQL Fun

    At the risk of looking foolish, what am I missing here?

    Is this not a case of:

    if (condition) or (condition)

    then

    else

    That's just an if-then-else statement.

    Both conditions equate to false, so...

  • RE: Indexes

    ma (9/7/2009)


    Now that's interesting. I filled "t" with your script. Including my initial data, there are 10288 rows. I ran the four queries and still get the only table scan...

  • RE: Indexes

    Hmmm... I played with this a little and the number of rows certainly makes a difference.

    I added 10,000 rows (actually 10,001 - as below) and this time query 1 gave...

  • RE: SQL 2008 T-SQL

    Jamie Longstreet (8/21/2009)


    Excellent question.

    First because it demonstrates the MERGE,

    Second because it illustrates the $action,

    Nice one!

    Actually, I was going to say much the same but got a bit...

  • RE: SQL 2008 T-SQL

    Wrong here too - I spent a lot of time deciding between answer 1 and 2, and as Paul mentioned above, plumped for 1 as the question asked about actions...

  • RE: Reclaiming freed space

    What an excellent and highly educational question - not often does a QotD make me rethink established strategies.

  • RE: Include field in SELECT but don't output?

    You can group by a column that is not in the select list... though it may produce a confusing result.

    e.g.

    BEGIN TRAN

    CREATE TABLE fred

    ...

  • RE: T-SQL : How to get resultset in the the order of conditions with "in" query

    sashikanta.mishra (6/17/2009)


    SELECT * FROM [dbo].[temp_OrderBy]

    WHERE name_name in ('Reymod','Tang','Kapil','John')

    You could use a CASE statement as an ORDER BY clause:

    ORDER BY

    CASE

    WHEN name_name = 'Reymod' THEN 1

    ...

  • RE: one character of data

    Akhil Kohli (6/14/2009)

    The answer should be char(1) as there is no information about unicode or non-unicode characters.

    Surely that very lack of information indicates the need to code defensively? NCHAR(1) is...

  • RE: one character of data

    pebbleonthebeach (6/8/2009)


    http://msdn.microsoft.com/en-us/library/ms176089.aspx states "Use char when the sizes of the column data entries are consistent."

    So char(1) is the recommended answer, although nchar(1) would be safer.

    ...and http://msdn.microsoft.com/en-us/library/ms186939.aspx states "Use...

  • RE: one character of data

    You can add my vote for nchar(1) - the question states one character but does not restrict that to plain old ascii. Given that information it would be highly irresponsible...

Viewing 15 posts - 46 through 60 (of 65 total)