Forum Replies Created

Viewing 15 posts - 151 through 165 (of 194 total)

  • RE: exceptional logic

    in this case the execution plan is identical between union and union all (SORT (DISTINCT SORT)). Precedence got me on this one 🙂 I'll chalk it up to...

  • RE: Name concatenations

    Without an identifier for whether a record is a business name that needs to be concatenated with out a space then there really is no way to do this.

  • RE: Getting the grip on value separated data

    Try the function by Jeff Moden that uses a Tally Table, much cleaner and faster.

    http://www.sqlservercentral.com/articles/T-SQL/62867/

  • RE: Elementary Key Attributes

    My only comment is that there is no identifier (per other QOTD's) of how many answers to answer... I got 2 out of 3 but still marked as wrong.

  • RE: Performanence issue on select query

    Chances are that 700K rows are used for some type of drill down report with a Summarization that is all anyone looks at. I know of reports that have...

  • RE: passing comma delimited string as parameter to stored proc

    Look up the work of Jeff Moden and the SQL 8K Delimited split function, then you just join that to your table. It avoids the issue of SQL Injection.

    here's...

  • RE: Group by on join

    kbartakke (9/28/2011)


    I tried to use your query but again its giving me all results and It didnt filter anything.

    Then you need to post sample data and the DDL. The...

  • RE: Group by on join

    kbartakke (9/28/2011)


    I have 2 tables Department and Employee and I want to find for each department, output the name of the employee with the highest salary.

    Department table

    eid ...

  • RE: TSQL Quotes Within Quotes

    hindle.steve (9/28/2011)


    Can anyone spot what is wrong with this?

    EXEC [LinkedServerName].master.sys.sp_executesql 'BACKUP DATABASE DB TO DISK =

    ''\UNCPath\DB.BAK''

    WITH COPY_ONLY, NOFORMAT, NOINIT, SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10'

    I'm getting a Procedure...

  • RE: Use of BETWEEN and DATETIME

    I thought the question was fine. The trickery would have gotten closer to an 80% failed if the possible answers had included the number 4. That was my...

  • RE: Are the posted questions getting worse?

    I read the article about the Amazon warehouse... I actually found it on first glance to be unbelievable. I live in the southern US where humidity and temperatures are...

  • RE: Multiple Records / Max Date with a Twist

    try using CAST(ISNULL(NullIF(dtDate, '999999'), '1/1/1900') AS DATETIME) for your selection, then use CASE WHEN ISNULL(dtdate,'1/1/1900') = '1/1/1900' THEN '99999' ELSE dtdate END

    Since I don't know your DDL and such, this...

  • RE: Nested While loop

    Michael,

    Here's some food for thought for you. Use the split function that Sean mentioned to split the strings into tables. Then join them (full outer join) and cursor...

  • RE: Are the posted questions getting worse?

    WayneS (9/19/2011)


    The Oops.txt file is EMPTY???? (At least Windows Explorer shows it to be 0 bytes, so this is consistent.)

    If you don't run the detach, you can see the table...

  • RE: Compare two records of the same table

    join the table to itself is what I would recommend... without code we can't be more specific... rarely is a cursor the best option.

Viewing 15 posts - 151 through 165 (of 194 total)