Forum Replies Created

Viewing 15 posts - 3,751 through 3,765 (of 6,037 total)

  • RE: delete duplicates

    > Not sure why Peter's 2k solution took so long on your machine, Serqiy.

    It's probably because Peter's solution consumes much more memory and size of intermediate results exceeds available memory.

    Try...

    _____________
    Code for TallyGenerator

  • RE: delete duplicates

    And results I've got are quite different:

    ===== Jeff ======

    DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    DBCC execution completed. If DBCC printed error messages, contact your system...

    _____________
    Code for TallyGenerator

  • RE: delete duplicates

    Strange...

    I always thought that

    FROM dbo.AilmentDetail_Test ad1,

    dbo.AilmentDetail_Test ad2

    WHERE ad1.AilmentID = ad2.AilmentID

    ...

    _____________
    Code for TallyGenerator

  • RE: execute string in a query

    It starts from point "Data Dictionary".

    _____________
    Code for TallyGenerator

  • RE: execute string in a query

    Rakesh,

    where you formula come from?

    Can users define formula?

    Is there any fixed set of formula your system supports?

    1st option is quite dangerous. It gives user a possibility to read data they...

    _____________
    Code for TallyGenerator

  • RE: Indexing Question

    Queries with criteria will use index if this index is clustered.

    Even if you query for less than 1% of rows in table optimizer does not know that when it's...

    _____________
    Code for TallyGenerator

  • RE: UNION IF query problem

    DECLARE @GroupMeat TABLE ( -- Must be static table in DB!

    Name nvarchar(100),

    Group nvarchar(100)

    )

    INSERT INTO @GroupMeat (Name, Group)

    SELECT N'COGS', N'COGS'

    UNION

    SELECT N'REVENUE', N'REVENUE'

    UNION

    SELECT N'Other Income', N'REVENUE'

    UNION

    SELECT N'Interest Income', N'REVENUE'

    UNION

    SELECT N'Gain on Disposal...

    _____________
    Code for TallyGenerator

  • RE: sort order

    I guess it's also about returning "20 first rows" or "Rows 21-40" in order specified.

    To do sorting in application you need to pump while dataset from DB, even if user...

    _____________
    Code for TallyGenerator

  • RE: Setting up RPC via Trigger

    Glenn,

    despite all your reasons the method you've chosen is unappropriate.

    End of story.

    There are a lot of other technical reasons why it should not be done this way.

    Rethink your approach.

    _____________
    Code for TallyGenerator

  • RE: Last Friday of given week

    Actually I did not find there any attempt of offence from your side.

    I just explained why I took it from the point of known...

    _____________
    Code for TallyGenerator

  • RE: Last Friday of given week

    I saw at least 3 different ways of interpreting "22nd week of the year".

    I believe OP knows better when Nth week starts and when it finishes, so it's up to...

    _____________
    Code for TallyGenerator

  • RE: Last Friday of given week

    This does not depend on DATEFIRST settings:

    Declare @d datetime

    SET @d = GETDATE()+1

    SELECT @d, DATEADD(dd, 6 - (@@Datefirst + Datepart(dw, @d) ) %7 , @d) as NextFriday

    Will return next Friday...

    _____________
    Code for TallyGenerator

  • RE: Need help with SELECT statement against unusual table...

    I don't think there is any need of changing table.

    I think in real life it does not matter which number is assigned to "Green" and which number is assigned to...

    _____________
    Code for TallyGenerator

  • RE: Setting up RPC via Trigger

    Not sure why do you need that table at all.

    It repeats information stored in master system tables.

    CREATE VIEW [dbo].[ControlTable]

    AS

    SELECT srvname AS SQLServer, srvid as ServerId, ...

    FROM master.dbo.sysservers

    GO

    Now, instead of...

    _____________
    Code for TallyGenerator

  • RE: sort order

    select empid,empname,jobrole

    from dbo.emp

    order by ISNULL(@DisableEmpidOrder, empid), ISNULL(@DisableEmpnameOrder, empname), ISNULL(@DisablejobroleOrder, jobrole)

    _____________
    Code for TallyGenerator

Viewing 15 posts - 3,751 through 3,765 (of 6,037 total)