Forum Replies Created

Viewing 15 posts - 3,856 through 3,870 (of 5,393 total)

  • RE: Locking a row

    Jeff Moden (10/7/2010)


    Man... well done. Just don't ever put something like this in a transaction... it will cause deadlocks in the "outside" world. Also, make the code handle...

    -- Gianluca Sartori

  • RE: Search Date-Month togetherly in a query; ignoring year.

    I think this should do:

    DECLARE @searchDate datetime

    SET @searchDate = '1985-03-26'

    SET @searchDate = DATEADD(day,DAY(@searchDate)-1,DATEADD(month, MONTH(@searchDate)-1, 0))

    SELECT *

    FROM astrology atr,

    store_dob...

    -- Gianluca Sartori

  • RE: Page Life Expectancy low vs Buffer Cache hit Ratio High

    Very strange. It's a question I don't see very often and we got two today.

    Here's the other one.

    -- Gianluca Sartori

  • RE: Problem query using indexes but still very slow

    hahnorlaska (10/7/2010)


    The attached show plan statistics outputs gives detailed information on what was being done to process the query (the physical operator. logical operator, argument, objects involved (indexes), row counts,...

    -- Gianluca Sartori

  • RE: ALERT / NOTIFICATION on triggers

    Probably your logging procedure was rolled back by an outer transaction.

    Try using db mail.

    -- Gianluca Sartori

  • RE: set @t1=(select sum(a) from order where type='1') + (select sum(b) from order2 where code='3')

    WayneS (10/7/2010)


    try:

    set @t1=IsNull((select sum(a) from order where type='1'),0) + IsNull((select sum(b) from order2 where code='3'),0)

    ... ok, it was me! 🙂

    -- Gianluca Sartori

  • RE: set @t1=(select sum(a) from order where type='1') + (select sum(b) from order2 where code='3')

    Is it me or there's a better way to describe this problem?

    I don't think I understand what you're after.

    Can you explain?

    -- Gianluca Sartori

  • RE: SQL Help

    You could start from the EXCEPT, that generally involves a SORT DISTINCT on the two inputs.

    I think you should calculate the output field AFTER the except.

    As a side suggestion, nobody...

    -- Gianluca Sartori

  • RE: similar like Oracle RAC

    Jeff Moden (10/7/2010)


    saurabh.deshpande (10/7/2010)


    Can we have anything like Oracle RAC available in SQL Server.

    Thanks

    What is "Oracle RAC"?

    Oracle RAC stands for Real Application Cluster, that is an...

    -- Gianluca Sartori

  • RE: Capture multi-server query results to table

    I don't think it can be done.

    When you run a query in multi-server mode, the query is run on each connected server and the results are merged by SSMS.

    Issuing SELECT...

    -- Gianluca Sartori

  • RE: ALERT / NOTIFICATION on triggers

    You could use db mail to send an alert to your mailbox.

    For some reason I feel that this is not exactly what you want. Can you elaborate a bit more?

    -- Gianluca Sartori

  • RE: Need advice on SQL Server Performance

    grahamc (10/7/2010)


    Something worth looking at is "write cache" on the SAN... I have had the same in the past where all-of-a-sudden performance falls through the floor (in a very bad...

    -- Gianluca Sartori

  • RE: Locking a row

    Nobody can acces the row while you're updating it.

    Don't worry about that.

    -- Gianluca Sartori

  • RE: Locking a row

    It could be something like this:

    CREATE PROCEDURE [getSequence]

    AS

    BEGIN

    SET NOCOUNT ON

    DECLARE @newVal int

    BEGIN TRY

    BEGIN TRAN

    UPDATE SequenceTable

    SET @newVal = Sequence = Sequence + 1

    COMMIT

    END TRY

    BEGIN CATCH

    DECLARE @ErrorMessage NVARCHAR(4000);

    DECLARE @ErrorSeverity INT;

    DECLARE @ErrorState INT;

    SELECT...

    -- Gianluca Sartori

  • RE: Page Life Expectancy

    I suspect this is due to memory pressure, but I find it hard to relate to db mirroring.

    Have you checked your memory usage stats?

    -- Gianluca Sartori

Viewing 15 posts - 3,856 through 3,870 (of 5,393 total)