Forum Replies Created

Viewing 15 posts - 2,611 through 2,625 (of 5,394 total)

  • RE: PIVOT Query For DateTime

    Please read the first article linked in my signature line and find out how to post to get the best answer from the forums.

    We need:

    1) Table scripts

    2) Sample data

    3) Expected...

  • RE: How are views stored in SQL Server?

    jared-709193 (9/26/2011)


    How are Views stored in SQL Server? The obvious answer will be "they are saved queries," yet somehow this is not really the case. For example, you can use...

  • RE: Needed help to convert column as row values

    veenavidyakaran (9/26/2011)


    Hi,

    privide me solution for dynamic change of column(Dealer1, Dealer2....) in the previous code i provided

    Regards,

    Veena Vidyakaran

    You could use dynamic sql to build the UNPIVOT/PIVOT trick based on your actual...

  • RE: error handling

    nikethan1985 (9/26/2011)


    Further i am planing to log the error , so raise error method will not be much helpful i think so .........

    You're catching the error in the...

  • RE: Select top row and second top row from DIM table

    You code works only if strategy key is ever-increasing.

    This should work regardless of that:

    DECLARE @dim_strategy TABLE (

    Strategy_id char(9),

    efct_start_dt datetime,

    efct_end_dt datetime,

    strategy_key int

    )

    INSERT INTO @dim_strategy VALUES ('GT-537791', '2011-01-21 03:11:27.000', '2011-07-02...

  • RE: Select top row and second top row from DIM table

    This should do:

    SELECT TOP(1) *

    FROM publish.dim_strategy

    WHERE strategy_id = 'gt-537791'

    ORDER BY efct_end_dt DESC

  • RE: Query to get database info from multiple Linked servers

    Try this:

    DECLARE @srvname varchar(100)

    DECLARE @getDatabase CURSOR

    declare @sql varchar(200)

    SET @getDatabase = CURSOR FOR

    SELECT srvname -- << No need for a variable here, let the cursor fetch it

    FROM

    master.dbo.sysservers

    OPEN @getDatabase

    FETCH NEXT

    FROM @getDatabase...

  • RE: error handling

    You could also capture the error in the inner CATCH block and throw it again with RAISERROR:

    BEGIN TRY

    BEGIN TRY

    EXECUTE usp_ExampleProc

    END TRY

    BEGIN CATCH

    --SELECT ERROR_NUMBER() AS ErrorNumber

    -- , ERROR_SEVERITY() AS ErrorSeverity;

    RAISERROR(ERROR_MESSAGE(),ERROR_SEVERITY(), ERROR_STATE());

    END...

  • RE: EXECUTE permission denied on object 'sp_start_job'

    In order to start a job, the user must be granted one of the fixed SQLAgent roles in msdb.

    See here for more info:

    http://msdn.microsoft.com/en-us/library/ms188283.aspx?ppud=4

  • RE: how to find Ram memory occupied by sql server

    vaithi.saran846 (9/25/2011)


    Hi,

    Either through front end or back end query anything is enough.. Please send to me

    Regards,

    Vaithilingam.K

    Based on Gail's suggestion, this should do:

    SELECT cntr_value

    FROM sys.dm_os_performance_counters

    WHERE counter_name =...

  • RE: how to find Ram memory occupied by sql server

    GilaMonster (9/23/2011)


    Gianluca Sartori (9/23/2011)


    I always feel safer when I set up a SQL_SERVICE user on my laptop with no special permissions. Maybe I'm paranoid, but that's just how I feel....

  • RE: UPDATE without listing all columns?

    Jeff Moden (9/24/2011)


    Apparently the OP has left the building. 😉

    Elvis? 🙂

  • RE: Slow Cursor

    Ninja's_RGR'us (9/23/2011)


    montyismobile (9/23/2011)


    Hi Gianluca Sartori,

    I would like to thank you for all your help with this cursor issue. When tested against the same data set your query produced identical...

  • RE: Slow Cursor

    montyismobile (9/23/2011)


    Hi Gianluca Sartori,

    I would like to thank you for all your help with this cursor issue. When tested against the same data set your query produced identical results...

  • RE: how to find Ram memory occupied by sql server

    GilaMonster (9/23/2011)


    Gianluca Sartori (9/23/2011)


    So, why does TaskManager display wrong info for sqlservr.exe? Is there a particular reason?

    Yes, it's not a bug (not really)

    I could plug Jonathan Kehayias's upcoming book that...

Viewing 15 posts - 2,611 through 2,625 (of 5,394 total)