Forum Replies Created

Viewing 15 posts - 6,151 through 6,165 (of 7,608 total)

  • RE: Percent Difference

    4 / 1172.0 is less than 1%, ~0.34%.

    To show less than 1%, change your code to this:

    CONVERT(DECIMAL(5, 2), (CAST(ProductionCnt.Count AS FLOAT)

    - CAST(avgcnt.Count AS FLOAT))

    / CAST(avgcnt.Count AS FLOAT) * 100) AS...

  • RE: Data Loading from Staging to Development -

    >> Do I need to disable Index while loading data from Dev to staging ? <<

    Can't say for sure without more details, but if it is a large % of...

  • RE: Find the Numbers from a string

    Underlying code/logic:

    SELECT

    string,

    --len(string), last_numeric_char, length_of_numeric,

    SUBSTRING(string, last_numeric_char - length_of_numeric + 1, length_of_numeric)

    FROM (

    SELECT '123756zxfggr123456' AS string...

  • RE: The character string that starts with ... is too long. Maximum length is 4000

    I believe the "EXECUTABLE FILE = " is supposed to be a file path to the executable, not the executable binary code itself.

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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....

  • 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]...

  • 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...

  • 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...

Viewing 15 posts - 6,151 through 6,165 (of 7,608 total)