Forum Replies Created

Viewing 15 posts - 5,311 through 5,325 (of 6,036 total)

  • RE: group by 1/2 hour

    SELECT ....

    FROM ....

    GROUP BY DATEDIFF(n, 0, )/30

  • RE: Casting error

    2 Tim,

    just one note.

    Bigint is 8 byte, not 16.

    Varchar can NEVER be more effective than numeric. It uses only 26 combinations out of 128. Ratio is 5:1. 100:20 in...

  • RE: Casting error

    It's funny, but I never have read from anybody designed those databases, everybody just inherited and does not have a chance to change anything.

    In...

  • RE: Need to Tune Query

    The design of your tables is terribly wrong.

    But anyway it would be useful at least to have some indexes on columns mentioned in the query.

  • RE: Casting error

    If ObligationNo is not ment to contain anything but integer values, why it's varchar?

    Just to increase number of lines of code and probability of errors?

  • RE: select the result set into a temp table

    Must be set up in database:

    Create Table dbo.Condition (

    Condition nvarchar (250),

    EmpId int

    )

    INSERT INTO dbo.Condition (Condition, EmpId)

    SELECT 'test', 30

    UNION

    SELECT 'test1', 40

    SP:

    IF NULLIF(@condition, '') IS NULL

    SET @condition =...

  • RE: Looping?

    If you need to delete all rows in the table use TRUNCATE TABLE.

    If you need to leave minor number of rows copy them to temp table, do TRUNCATE and copy...

  • RE: Multiple Table Selection

    Too many tables.

    Those 5 must be in one with double key:

    Labels:

    ID     TypeId             NAME        LABEL

    1            4         PUBCODE  PUBLICATION CODE

    2            2         USERMENU   MENU FOR USER

    4            3         INPUT TEXT     ENTER TEXT

  • RE: handling NULL''''s

    That's a complete query.

    What else you want to see?

  • RE: Divide update into batches

    Yes, of course.

  • RE: Divide update into batches

    DECLARE @N int, @Cnt int, @Range int

    SELECT Identity(int, 1,1) as id, AccountID

    INTO #ActiveAccounts

    FROM Account WITH (NOLOCK)

    WHERE ProviderID = 70 AND IsActive = 0

    SELECT @Cnt =...

  • RE: Why does this take so long?

    Second AND is applied to subset returned by first AND.

    Second OR is applied to the same original set of rows as first one. Results of both OR's are united.

  • RE: Conditions in SELECT

    SELECT

     wkey,

     STATYR,

     'N' AS overrideFlag,

     ROUND (100 * ISNULL(((GENBUD + APPSPC + DHMBB + NBCCOL + NTSCOL) / NULLIF(GRDTOT - (GENBUD + APPSPC + DHMBB + NBCCOL +...

  • RE: Why does this take so long?

    You've got whole bunch of big NO's in your query. Every one of them will kill performance because of full table scans and huge datasets being copied to tempdb.

    1. Checking...

Viewing 15 posts - 5,311 through 5,325 (of 6,036 total)