May 7, 2019 at 12:36 pm
I just posted a topic in the SQL 2012 T-SQL forum group and the board removed all the line spaces between sections of code, making (to my eyes) what I posted completely unreadable. It's hard to tell one line from another, even though when I go to edit the post, the code box shows my line breaks and therefore renders the code more readable again.
Can someone look into this? https://www.sqlservercentral.com/forums/topic/converting-substring-to-datetime-extra-eyes-please
May 7, 2019 at 4:51 pm
Can you post an image of what you want this to look like? From your description, it's hard to decide what things you want changed. We added scrolling, so there isn't a need to break lines. Do you mean lines between lines of code? In SSMS, there's often essentially a "br" break, not a "p" paragraph break.
May 7, 2019 at 7:36 pm
I was just trying it out....if you have a chunk of sql and then have several cr/lf, those lines just disappear so the code is all together instead of having the empty lines for readability. Like a section declaring variables, then a few empty lines then some code, it ends up with no empty lines in between. Just one line after another with no empty lines. If you put them in the editor, paste from SSMS, paste from notepad, I didn't find a way to have the empty lines. Something like:
DECLARE @SomeVar int = 5
SELECT @SomeVar
displays as
DECLARE @SomeVar int = 5
SELECT @SomeVar
Sue
May 7, 2019 at 7:45 pm
Well...I can't get it to show correctly on pasting....sorry about that. But the empty lines are removed and it does make things less readable. Brandi's example has no spaces and I would guess she had breaks in there for readability.
May 7, 2019 at 8:53 pm
Hmm, OK, let me try something.
SELECT *
FROM dbo.Articles AS a
GO
-- two line breaks before this
-- Test as SallyDev
EXECUTE AS USER = 'SallyDev'
SELECT *
FROM dbo.Articles AS a
REVERT
GO
-- one line break before here
-- Grant permissions
GRANT SELECT, INSERT ON dbo.Articles TO SallyDev
GO
-- Re-test as SallyDev
EXECUTE AS USER = 'SallyDev'
SELECT *
FROM dbo.Articles AS a
REVERT
GO
May 7, 2019 at 8:53 pm
OK, I think we have this filed somewhere, but I'll check on it.
May 8, 2019 at 12:25 pm
Sorry I didn't have a chance to respond yesterday. It was very busy at work.
But yes, that's exactly my problem. What Sue said and what you posted.
May 9, 2019 at 1:21 pm
This was driving me nuts too. I tried a few things in post to see if there was a way around it but I think I edited one too many times. Now the post is deleted...lol
May 9, 2019 at 4:02 pm
Another test here, a partial (or whole) fix is in:
SELECT *
FROM dbo.Articles AS a
GO
-- two line breaks before this
-- Test as SallyDev
EXECUTE AS USER = 'SallyDev'
SELECT *
FROM dbo.Articles AS a
REVERT
GO
-- one line break before here
-- Grant permissions
GRANT SELECT, INSERT ON dbo.Articles TO SallyDev
GO
-- Re-test as SallyDev
EXECUTE AS USER = 'SallyDev'
SELECT *
FROM dbo.Articles AS a
REVERT
GO
May 9, 2019 at 4:03 pm
🙂
May 9, 2019 at 4:06 pm
May 9, 2019 at 6:36 pm
--That's Great News!
--Thanks ;)
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply