Forum Replies Created

Viewing 15 posts - 2,536 through 2,550 (of 5,393 total)

  • RE: Loop within a loop... BUT...

    Can you post some sample data, so that we can try to set up some code for you?

    Read the first article linked in my signature line and you will find...

    -- Gianluca Sartori

  • RE: Intervals of values

    It's an "island" problem.

    Try this:

    --setup

    DECLARE @test-2 TABLE

    (

    [Index] INT,

    [Value] INT,

    [Stamp] DATETIME

    )

    INSERT INTO @test-2 VALUES (1, 1, '2007-08-03 08:00:00.000');

    INSERT INTO @test-2 VALUES (2, 1, '2007-08-05 08:00:00.000');

    INSERT INTO @test-2 VALUES (3, 3,...

    -- Gianluca Sartori

  • RE: Unsure of SQL batch

    The command you posted comes from the "Details" window? Is the "Command" column empty or does something show up?

    In the first case, it's the last command run from that connection...

    -- Gianluca Sartori

  • RE: Loop within a loop... BUT...

    You can use Database Mail. sp_send_dbmail can send query results as an attachment or inline e-mail body.

    If you share more details, we could try to help.

    -- Gianluca Sartori

  • RE: Unsure of SQL batch

    Is it in sys.dm_exec_sessions?

    -- Gianluca Sartori

  • RE: Job

    Or in SSMS, right click the job, view job history.

    There's a column named "duration".

    -- Gianluca Sartori

  • RE: Unsure of SQL batch

    Running? I suppose it's not.

    What does

    SELECT status FROM sys.dm_exec_requests WHERE session_id = [session_id of the process]

    return?

    -- Gianluca Sartori

  • RE: Unsure of SQL batch

    Looks like application code. What are you worried about exactly?

    -- Gianluca Sartori

  • RE: Need Help on SQL Query

    It's a fun question!

    This is the best I could come up with, but I'm sure there's a better/simpler way.

    DECLARE @Table1 TABLE (

    ItemID int,

    ItemName nvarchar(100),

    ItemPrice money

    );

    INSERT INTO @Table1 VALUES (101, 'McDonald''s',...

    -- Gianluca Sartori

  • RE: ISZERO

    I suggest avoiding this kind of expression. It can easily bring performance issues as it's prone to bad parameter sniffing.

    Use dynamic SQL instead:

    DECLARE @sql nvarchar(max)

    SET @sql = '

    SELECT *

    FROM User

    WHERE...

    -- Gianluca Sartori

  • RE: dbcc checkdb fails (nightmare scenario)

    serr4no (10/4/2011)


    Database consists of 30+ files with a main .mdf and .ndf partitions.

    Total size: 3,7 TB

    I know that my comment is totally useless now, but, hell, why don't you have...

    -- Gianluca Sartori

  • RE: Transaction Count Error Message After Execute

    I see no commit in this cose.

    Take a look at my stored procedure code template[/url] for an example.

    Hope this helps

    Gianluca

    -- Gianluca Sartori

  • RE: Index Rebuilds

    You probably want to shrink the log to the size it was before the reindex started.

    The reindex command can grow the log enormously. Be sure to take log backups during...

    -- Gianluca Sartori

  • RE: Is MSDTC essential for SQL server 2008R2 failover cluster installation

    No, it's not mandatory. You can have a cluster without a MSDTC resource.

    However, I would recommend it. You will find the reasons here: http://technet.microsoft.com/en-us/library/cc730992(WS.10).aspx?ppud=4

    -- Gianluca Sartori

  • RE: Filtering null record via proc sql or view

    +1.

    However, you could calculate the SUM on the whole column in advance and use the sum to decide whether displaying or hiding the column:

    DECLARE @testData TABLE (

    [Kagit Cinsi] nvarchar(10),

    [Sari] int,

    [Yesil]...

    -- Gianluca Sartori

Viewing 15 posts - 2,536 through 2,550 (of 5,393 total)