SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


New Code formatting engine rolled out


New Code formatting engine rolled out

Author
Message
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)

Group: General Forum Members
Points: 269684 Visits: 42193
GilaMonster (10/8/2009)
Testing....

Using an inequality character
SELECT session_id FROM sys.dm_exec_requests WHERE session_id > 50



Using escape codes for inequality
SELECT session_id FROM sys.dm_exec_requests WHERE session_id > 50



Using angle brackets to designate a placeholder
USE <Database Name>



Using escape codes to designate a placeholder
USE <Database Name>



Edit: Ok, can someone tell me the secret to posting angle brackets please?


--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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)

Group: General Forum Members
Points: 269684 Visits: 42193
Testing Gails Problem...

SELECT 1 WHERE A > B



SELECT 1 WHERE A > B



--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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)SSC Guru (269K reputation)

Group: General Forum Members
Points: 269684 Visits: 42193
Ah... got it. If you type the code in between the code markers, you get the & gt ; character representation. If you paste between the code markers from SSMS, it works just fine.

--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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
GilaMonster
GilaMonster
SSC Guru
SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)

Group: General Forum Members
Points: 290135 Visits: 46650
That doesn't really help me. I've got a fair few 'templates' that I have set up for quick insert via a firefox plugin. Cutting them to management studio and pasting back's time consuming.

Ben, can you maybe look into the < and > please. Should be able to type them in in code blocks.

More testing... Created one of my clippings by copying from SSMS...

DBCC CHECKDB (<Database Name>Wink WITH NO_INFOMSGS, ALL_ERRORMSGS



directly pasted
DBCC CHECKDB (<Database Name>Wink WITH NO_INFOMSGS, ALL_ERRORMSGS



Forums don't like me evidentially....

Once more with feeling. Written in management studio, copy, paste

SELECT Something FROM SomeWhere WHERE Col1 <> Col2



:-(

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Jeffrey Williams 3188
Jeffrey Williams 3188
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24606 Visits: 10073
SELECT <column list>; FROM <your table here>


SELECT <column>



Like this?

Edit: interesting, worked on preview - then gets modified as above.

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

GilaMonster
GilaMonster
SSC Guru
SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)

Group: General Forum Members
Points: 290135 Visits: 46650
Jeffrey Williams-493691 (10/8/2009)
Edit: interesting, worked on preview - then gets modified as above.


Yeah, I noticed that earlier.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Jeffrey Williams 3188
Jeffrey Williams 3188
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24606 Visits: 10073
I played around with it a little and preview works fine, even if you put in < and > - not sure what is going on there.

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

Jeffrey Williams 3188
Jeffrey Williams 3188
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24606 Visits: 10073
Jeffrey Williams-493691 (10/8/2009)
I played around with it a little and preview works fine, even if you put in < and > - not sure what is going on there.


Dang it - replaced my
< and >

. Weird...


SELECT <<test>> -- edited



Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

GilaMonster
GilaMonster
SSC Guru
SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)SSC Guru (290K reputation)

Group: General Forum Members
Points: 290135 Visits: 46650
Hmmm...

SELECT Something FROM SomeWhere WHERE Col1 <> Col2



DBCC CHECKDB (<Database Name>Wink WITH NO_INFOMSGS, ALL_ERRORMSGS



Forums definitely don't like me. Crying

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Jeffrey Williams 3188
Jeffrey Williams 3188
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24606 Visits: 10073
SELECT <Something> FROM SomeWhere WHERE ...



Well - that didn't work either...

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search