Kudos on this choice forum software !!

  • If I forgot to mention it, huge thanks to those responsible for getting this new forum software.  Really nice !

  • Have you tried to post any code, yet?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Yes that works well.  And I see you can do some common formatting such as Control B for bold without having to access the Format button. The preview is immediate and very helpful.  Adding a file is easier than what I recall in the past.  Haven't tried the double quote button or   IF CODE yet.


    EXEC sp_whoisactive @find_block_leaders = 1, --@get_additional_info = 1,--@format_output = 2,
        @sort_order = '[blocked_session_count] desc',-- '[cpu] desc', --
       @output_column_list = '[dd hh:mm:ss.mss][session_id][database_name][block%][sql_text][host_name][login_name][start_time][login_time][percent_complete][sql_command][used_memory][temp%]
    [wait_info][?tasks][tran_log%][cpu%][reads%][writes%][context%][physical%][quer?y_plan][locks][collection_time]';
    go

    Direct paste from SSMS Grid results:
    dd hh:mm:ss.mss    session_id    database_name    blocking_session_id    blocked_session_count
    11 01:53:33.010    51    master    NULL          0
    00 00:00:00.573    83    COLLATERALMANAGER    NULL          0
    00 00:02:12.520    123    Reporting    NULL          0

    Direct Paste ssms results from Excel -- gridlines are dropped -- good formatting otherwise

    tablenamenametype_descis_uniquedata_space_id
    ifts_comp_fragment_2009058193_33698738clustCLUSTERED166865
    ACCOUNT_OWNERSHIP_DOC_SUMMARYACCOUNT_OWNERSHIP_DOC_SUMMARY_UC1NONCLUSTERED165628

    SSMS Grid Result pasted into HTML Outlook Email, then copied here   ( forum software Pop-up note - We've noticed you are pasting content from Microsoft Word. Would you like to clean the content so it appears correctly)   Seems like I saw this work fairly well on some things, but not here.
    dd hh:mm:ss.mss    session_id     database_name      blocking_session_id          blocked_session_count
    11 01:53:33.010      51      master          NULL                    0
    00 00:00:00.573      83      COLLATERALMANAGER  NULL                    0
    00 00:02:12.520      123     Reporting      NULL                    0

    login_name   start_time    login_time    percent_complete
    NT AUTHORITY\SYSTEM    2017-03-19 02:53:35.310 2017-03-19 02:53:35.307          NULL
    CM\DefaultAppPoolID        2017-03-30 04:47:07.747 2017-03-30 04:47:07.747          NULL
    CM\DefaultAppPoolID        2017-03-30 04:44:55.800 2017-03-30 02:31:56.683          NULL
    CM\FdiEvent_Prod   2017-03-30 04:47:08.290 2017-03-30 04:47:07.860 NULL
    CM\DefaultAppPoolID        2017-03-30 04:47:01.827 2017-03-30 04:47:01.820          NULL
    CM\FdiEvent_Prod   2017-03-30 04:47:08.293 2017-03-30 04:47:07.973 NULL

  • I've found that copying and pasting from SSMS directly to an SQL Code window makes a train wreck of things.  Turns out that they only have limited support for IE pastes.  I have to copy from SSMS into Notepad and then copy'n'paste from that to the SQL Code window. 

    What was the method you used to copy to the code window above and which web browser are you using?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden - Thursday, March 30, 2017 8:10 AM

    I've found that copying and pasting from SSMS directly to an SQL Code window makes a train wreck of things.  Turns out that they only have limited support for IE pastes.  I have to copy from SSMS into Notepad and then copy'n'paste from that to the SQL Code window. 

    What was the method you used to copy to the code window above and which web browser are you using?

    posting tsql directly from SSMS into SSC post using copy and paste and the "SQLcode" shortcut give this for me using Chrome

    DECLARE @sql AS VARCHAR(MAX);
    WITH cte
      AS (SELECT DISTINCT
          CAST(WeekNo AS DATE) AS WeekNo
       FROM dbo.Staging
       WHERE WeekNo <> '')
      SELECT @sql = 'SELECT [ProjectWork Number]'+CHAR(13)+CHAR(10)+
      (
       SELECT ' , ISNULL(MAX(CASE WHEN CAST(WeekNo AS DATE) = '+''''+CAST(WeekNo AS VARCHAR(12))+''''+' THEN WeekValue END), 0) AS '+''''+CAST(WeekNo AS VARCHAR(12))+''''+CHAR(13)+CHAR(10)
       FROM cte
       ORDER BY WeekNo
       FOR XML PATH(''), TYPE
      ).value('./text()[1]', 'nvarchar(MAX)')+' FROM Staging'+CHAR(13)+CHAR(10)+' GROUP BY [ProjectWork Number]';
    PRINT @sql;
    EXECUTE (@sql);

    which is good for me.

    What grinds my gears on this new software

    • is the time to load/reload "unread posts"....5-6secs on average...and I have in excess of 45Mbps download speed  ......huh???
    • Any posts I make never reflect local time at all......seem to be flagged some in the US time regions
    • trying to format plain/ASCII text used to be easy...just use the "plain" codes.....doesn't work like that anymore it seems...

    But what grinds my gears more than anything else....the total lack of information that could be displayed on the "unread" page....so much white space and no info

    • I don't know who the poster is....without having to hover an icon
    • I don't know the date it was originally posted 
    • I don't know the forum it was posted in

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • Jeff
    I use Chrome and if I use the Sql Code button  below, pasting in Tsql works just fine.   It's the results that are problematic -- ssms grid results.
    It's just an extra step to paste into excel, add gridlines, make sure date/times show properly, then save the file and add to a post here.
    That's the only really clean way I've found to get results in here.

    I've found that copying and pasting from SSMS directly to an SQL Code window makes a train wreck of things. Turns out that they only have limited support for IE pastes. I have to copy from SSMS into Notepad and then copy'n'paste from that to the SQL Code window. 

    What was the method you used to copy to the code window above and which web browser are you using? 

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply