Forum Replies Created

Viewing 15 posts - 6,166 through 6,180 (of 7,619 total)

  • RE: Ideas on how to flag existing user tables for future deprecation

    You could create table(s) to hold info about changes that need done in the future.

    Since these will be temporary/transition tables, you wouldn't need to spend a huge amount of time...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Number of columns in table

    Lynn Pettis (4/8/2014)


    ScottPletcher (4/8/2014)


    Jeff Moden (4/7/2014)


    ScottPletcher (4/7/2014)


    If you really want to use a single table, you could use a single smallint or int column with a bit assigned to each...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Number of columns in table

    Jeff Moden (4/7/2014)


    ScottPletcher (4/7/2014)


    If you really want to use a single table, you could use a single smallint or int column with a bit assigned to each newsletter. That...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Number of columns in table

    If you really want to use a single table, you could use a single smallint or int column with a bit assigned to each newsletter. That isn't necessarily a...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Delete a column in all tables

    D'OH, sorry, quite right, here's a

    CORRECTED script:

    EXEC sp_MSforeachtable '

    IF EXISTS ( SELECT * FROM sys.columns

    WHERE object_id = OBJECT_ID(''?'') AND name = ''SSMA_TimeStamp'' )

    BEGIN

    PRINT ''Altering table...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Table Partitioning

    todd 87764 (4/4/2014)


    The table will continue to grow as there are no plans for archiving, which is why I am thinking about partitioning. There COULD be as many as...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Delete a column in all tables

    EXEC sp_MSforeachtable '

    IF EXISTS ( SELECT TOP (1) * FROM sys.columns

    WHERE object_id(''?'') IS NOT NULL AND

    name = ''SSMA_TimeStamp'')

    BEGIN

    PRINT ''Altering table "?" to remove column...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Table Partitioning

    There is a clustered primary key on an ID column ... The partition key needs to be placed on a DATETIME column ... 23M rows

    23M rows is not that many....

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Copying data from one set of tables to another

    ErikMN (3/27/2014)


    RBarryYoung (3/27/2014)


    OK, here's my crazy, shoot-from-the-hip shortcut idea:

    1) Make a new schema in your source DB called [Export]

    2) For each table to be exported, create a View in [Export]...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: How to get the date?

    I prefer to avoid anything that is date or language setting dependent; DATEDIFF(DAY, 0, first_day_of_month) % 7 will yield a value that never changes no matter what the SQL setup...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Fill in the gap between 2 number range

    You don't need to actually INSERT rows to use those values in a computation. Simply determine the number of "steps" between each row, and multiply the value in the...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: how to do duration in hours with ragged data

    To me, splitting it is the trivial part. Analyzing all the possible variations will be vastly more complex.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Best way to expose msdb information

    If possible, I'd just add code to that job to write its status to a table in the other db. That way you could avoid referencing msdb at all...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Convert Float to a Phone Number

    I doubt you'll be able to recover the full number. Floats are imprecise beyond their guaranteed number of digits. You'll likely have to re-export the data.

    That said, you...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: GUID Pirmary key

    andrew gothard (4/2/2014)


    ScottPletcher (3/30/2014)


    andrew gothard (3/29/2014)


    Simple arithmetic, if you have 8k pages, one row per page (and we know that it's going to be bigger than that), 12500 rows. ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 6,166 through 6,180 (of 7,619 total)