Forum Replies Created

Viewing 15 posts - 3,481 through 3,495 (of 5,393 total)

  • RE: Not able to get the column in dynamic query

    The compiler doesn't like the doubel parenthesis around your @sql string:

    DECLARE @CID BIGINT,@SQL NVARCHAR(2000),@Val CHAR(8),@ID INT,@SQL1 NVARCHAR(800),@C INT,

    @Column_Val_R VARCHAR(200)

    SET @CID = 123

    SET @C = 2

    SET @ID = 2

    SET @sql =...

    -- Gianluca Sartori

  • RE: Table level timestamp

    Glad I could help.

    -- Gianluca Sartori

  • RE: Calculating Open incidents per month

    Glad I could help.

    Thanks for the fun in coding it. 🙂

    -- Gianluca Sartori

  • RE: collation conflict in sqlserver 2005

    You're welcome.

    Glad I could help.

    -- Gianluca Sartori

  • RE: Stored Procedure suspending and running itself

    Usually, when the optimizer decides to pick a parallel plan it's because it could not find something "smarter" to do.

    Operators that fit well in a parallel plan are hash joins,...

    -- Gianluca Sartori

  • RE: Calculating Open incidents per month

    Your question was really interesting, so I coded another solution that works with a more efficient plan, using UNPIVOT:

    ;WITH Incident_Events AS (

    -- Create an event sequence...

    -- Gianluca Sartori

  • RE: collation conflict in sqlserver 2005

    jamessdba (2/3/2011)


    please update

    Sure! Just don't be so impatient... We are all volunteers on these forums and we answer questions during our free time.

    To set the collation during setup, you...

    -- Gianluca Sartori

  • RE: Table level timestamp

    jamesmario (2/3/2011)


    Thanks for your reply. when i ran this query by setting a new value to @last_updated_min, i didn't get any results back and no error message showed up. The...

    -- Gianluca Sartori

  • RE: Calculating Open incidents per month

    OK, I think I got it.

    I hope this is not overcomplicating the initial problem...

    ;WITH Incident_Events (Project, Event_Time, Event_Type, SumAs)

    AS (

    -- Create an event sequence

    ...

    -- Gianluca Sartori

  • RE: Table level timestamp

    DBA_Dom (2/3/2011)


    With 2005 and later we now have the DMVs that can be used for this. Take a look at the sys.dm_db_index_usage_stats view. It has the last_user_scan,...,last_user_update columns. One thing...

    -- Gianluca Sartori

  • RE: Calculating Open incidents per month

    When posting a question such as this one, you should provide:

    1) A script to create a test table to hold sample data

    2) A script to insert some sample data in...

    -- Gianluca Sartori

  • RE: Table level timestamp

    Unfortunately there's no built-in "last updated" property for table data, you will have to calculate it from table data itself.

    You could create a dynamic sql to check all the tables...

    -- Gianluca Sartori

  • RE: Are the posted questions getting worse?

    Lynn Pettis (2/2/2011)


    Amazing it is how arrogant some may be.

    And then to post here as well?

    Yet another troll. If you don't feed them, they starve and disappear.

    -- Gianluca Sartori

  • RE: SSPI Context Error Logged in the SQL Error Log.

    It could definiely be a different case, but this is the issue we were experiencing:

    http://support.microsoft.com/kb/973667/en-us

    I hope this helps in your scenario as well.

    Gianluca

    -- Gianluca Sartori

  • RE: INSTEAD OF TRIGGER + VIEW

    GilaMonster (2/2/2011)


    Is FIRE_TRIGGERS specified for your OLEDB destination? By default the bulk inserts do not fire triggers, if you want them to you need to specify it.

    Google terms - Fire_Triggers...

    -- Gianluca Sartori

Viewing 15 posts - 3,481 through 3,495 (of 5,393 total)