Forum Replies Created

Viewing 15 posts - 7,126 through 7,140 (of 7,597 total)

  • RE: t-sql - days to week and days

    Jeff Moden (10/3/2012)


    sqlserver12345 (10/2/2012)


    How do I convert days into weeks and days

    Ex:350 days = 50 0/7 weeks

    351 days = 50 1/7 weeks

    352...

  • RE: UNIQUEIDENTIFIER vs BIGINT

    Jeff Moden (10/3/2012)


    ScottPletcher (10/3/2012)


    Determing the appropriate column actually takes analysis; again, there is no one-rule-fits-all-tables for the best clustered key column.

    Customer ids are usually unique and ever-increasing; narrowness is sometimes...

  • RE: UNIQUEIDENTIFIER vs BIGINT

    Jeff Moden (10/3/2012)


    Use the clustered index for a more appropriate column

    For large tables, the "appropriate column" is usually unique, narrow, and ever-increasing. "Customer Code" columns almost never meet all...

  • RE: t-sql - days to week and days

    --

    --

    SELECT

    col1, col2, days,

    CAST(days / 7 AS varchar(5)) + ' ' + CAST(days % 7 AS varchar(1)) + '/7' AS weekdays

    FROM...

  • RE: Database change policy and procedure

    Backup and restore requests.

    I've done away with a lot of the "requests" -- just provide 'em a stored proc that can be run to do the backup. The stored...

  • RE: Running out of Identity values

    Eugene Elutin (10/3/2012)


    ScottPletcher (10/3/2012)

    ...

    Why would the relative position of the column make the slightest bit of difference at all?

    It may effect page splits and re-writes.

    ?? How is that??

    Fixed-length columns...

  • RE: Get the overall status of a particular product

    An uncontrolled MIN() could fail as other Statuses appear in the table.

    I suggest directly coding for the specific condition you are looking for:

    SELECT

    Product,

    ...

  • RE: How can I find the first column having NULL values in a table

    In this case ;-), I think a simple CASE will do exactly the same thing:

    SELECT TOP 1

    CASE WHEN Col1 IS NULL THEN 1 WHEN...

  • RE: My 3 year old desktop SQL Server outperforms my spanking new SQL Server !

    Along those lines, make sure the statistics are up to date on the tables on the server as well.

    Also, a quick checklist of a few things to look at on...

  • RE: Database change policy and procedure

    Actually, Brendan, what you're described is what I've seen over and over.

    While well intentioned, such processes usually end up being roadblocks rather than welcome centers (to stay with the road...

  • RE: Running out of Identity values

    So I guess there's no issue with rows being UPDATEd / DELETEd while the new table is being created?

    Or with the potential lock outs/delays to current modifications during the export...

  • RE: TSQL Case Statement help

    ChrisM@Work (10/3/2012)


    ScottPletcher (10/2/2012)


    SQL Server is optimized to do table lookups, whereas CASE statements are comparatively very slow.

    Therefore, I suggest using a lookup table, as suggested by others. You absolutely...

  • RE: Get multiple rows of data based on one condition and grouping

    Eugene Elutin (10/2/2012)


    ...

    Given that a customer's name can change, perhaps it is an attribute of the purchase.

    ...

    Given that nothing in the Universe is constant and everything can change,...

  • RE: UNIQUEIDENTIFIER vs BIGINT

    Typically customer codes are sequential. Since they're not here, that would definitely make the clustering key choice much more difficult.

    If customer code is (almost) always used for lookups/processing, you...

  • RE: Running out of Identity values

    Eugene Elutin (10/2/2012)


    ScottPletcher (10/2/2012)


    sql-lover (10/2/2012)


    bteraberry (10/2/2012)


    ScottPletcher (10/2/2012)


    Maybe I'm missing something.

    Why not just ALTER the column to be a bigint instead of an int?

    He said these are very big tables. ...

Viewing 15 posts - 7,126 through 7,140 (of 7,597 total)