Forum Replies Created

Viewing 15 posts - 3,526 through 3,540 (of 5,502 total)

  • RE: How to obtain week by week plus YTD totals

    TheSQLGuru (5/14/2010)


    Unfortunately I don't have the time to work this today, but shouldn't this be doable with simple CASE statements in a single pass? Hopefully someone else can work...

  • RE: convert three fields into one datetime

    If you define your sour columns as character you might be able to use the following:

    SELECT CAST('2010'+'-'+'1'+'-'+'15' AS DATETIME)

  • RE: Display results even when there are none.

    The way you've arranged your tables you probably need a RIGHT OUTER JOIN to get all values from Staff.

  • RE: Bulk move notes from one customer record to another

    fawadafr (5/13/2010)


    Would this be a good table definition?

    SELECT .... FROM [CRMNote]

    GO

    Thanks for the reply!

    No, since the column definition is missing. There are no ready to use sample data either...

    Please...

  • RE: Bulk move notes from one customer record to another

    I would use ROW_NUMBER() OVER(PARTITION BY names, address, [basic contact info] ORDER BY hopefully_existing_rowid) as RowNmbr to identify the separate rows.

    The ROW_NUMBER would be used within a CTE in order...

  • RE: Sum pivot columns

    Would the following help?

    I'm using OVER (PARTITION BY) to get the total per idName.

    Side note: Since you already using dynamic SQL you might want to have a look at the...

  • RE: simple Insert - tune

    Tara,

    did you add any indexes after populating #EmployeeDur and Empgig1?

    If not, I guess the following indexes might help:

    Empgig1: EmpID,InDt include(EmpCode)

    #EmployeeDur: EmpID,StDate,EnDate

    Side note: Are you sure you need the DISTINCT clause...

  • RE: Free Advice or Free Consulting

    Excellent job, Grant!

    The only question that remains open is: Where to draw the line?

    But I guess it's almost impossible to answer...

    Interview questions, test/homework, almost complete projects, several hundred lines of...

  • RE: checkning for allowable values

    Jeff Moden (5/12/2010)


    Yes and no. You're certainly on the correct tract with making a table but it should be a permanent table instead of one built on the fly....

  • RE: checkning for allowable values

    Jeff Moden (5/12/2010)


    ...

    I'm still believe that the use of the Tally table here would be slower across a million rows than if the codes were stored in a nice...

  • RE: What is the accepted method for citing BOL in a presentation?

    I would quote the related msdn website.

    AFAIK, websites are allowed as references.

    e.g. http://msdn.microsoft.com/en-US/library/ms186734(v=SQL.90).aspx as a reference for the ROW_NUMBER() syntax.

    I would copy the website together with a date information for...

  • RE: How do I restrict a login to only 1 connectin to the database server?

    I second Brandie and Elliot regarding the sandbox db.

    Once that person "designed" a query he/she wants to run in production, that person should send the query to one of the...

  • RE: XML XQuey Help

    Please re-read my previous post: I asked for your expected result based on your sample data. I can't find it...

    All I see is

    ROW # FIELD NAME 1 ... FIELD NAME...

  • RE: checkning for allowable values

    Joe Celko (5/12/2010)


    Don't use the race codes table; remove the code from the string and see if it has left-overs:

    REPLACE('I', '',

    REPLACE('N', '',

    REPLACE('P', '',

    REPLACE('B', '',

    REPLACE ( 'W', '', mutli_race_code),

    ),),),)...

  • RE: XML XQuey Help

    Maybe the reason you didn't get any reply yet is the way you posted your question.

    There are some people around (including myself) that prefer to have ready to use sample...

Viewing 15 posts - 3,526 through 3,540 (of 5,502 total)