How to add T-SQL code to your WordPress blog

Standard

Ok, so as a new member of WordPress and the blogosphere (I’ve only been part of the Twitterati for one single year (I signed up at SQLBits XI) (I just wanted to say Twitterati)) I’m still finding my way around. My first question was “How in the name of Greek buggery do I add T-SQL code to my blog and make it look decent?”. Here’s how I tell ya!!

Step 1: Write your SUPERAWESOME code:

SELECT * FROM Dim.Booking

Step 2: Make it pretty: Prettifier

Step 3: Hit the Text button just above and to the right:
TextButton

Step 4: Put the results from Prettifier into some <pre class=”code“></pre> tags on the Text page where you want it

<pre class=”code“>

<code style=”font-size: 12px;”>
<span style=”color:blue”>SELECT </span>
<span style=”color:gray”>* </span>
<span style=”color:blue”>FROM </span>
<span style=”color:black”>Dim.Booking</span>
</code>

</pre>

Step 5: PROFIT:

SELECT * FROM Dim.Booking

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s