From: rodchar on
Hey Plamen,

BTW, How do you get your code snippets to show in your blogs like they do
(colored and indented like the code editor)?

If you don't mind me asking...
rod.


"Plamen Ratchev" wrote:

> This is creating table with numbers on the fly by cross joining CTEs. You can extend very easily:
>
> ;WITH N1 (n) AS (SELECT 1 UNION ALL SELECT 1),
> N2 (n) AS (SELECT 1 FROM N1 AS X, N1 AS Y),
> N3 (n) AS (SELECT 1 FROM N2 AS X, N2 AS Y),
> N4 (n) AS (SELECT 1 FROM N3 AS X, N3 AS Y),
> N5 (n) AS (SELECT 1 FROM N4 AS X, N4 AS Y),
> N6 (n) AS (SELECT 1 FROM N5 AS X, N5 AS Y),
> Nums (n) AS (SELECT ROW_NUMBER() OVER(ORDER BY n) FROM N6)
> ....
>
> --
> Plamen Ratchev
> http://www.SQLStudio.com
> .
>
From: Plamen Ratchev on
rodchar wrote:
>
> BTW, How do you get your code snippets to show in your blogs like they do
> (colored and indented like the code editor)?
>
There are many free SQL formatting tools out there, some better than others. I use the following (it does have issues
and does not show properly all keywords especially SQL Server 2008 syntax, but does good formatting):
http://www.simple-talk.com/prettifier/default.php

--
Plamen Ratchev
http://www.SQLStudio.com
From: rodchar on
Thanks,
rod.

"Plamen Ratchev" wrote:

> rodchar wrote:
> >
> > BTW, How do you get your code snippets to show in your blogs like they do
> > (colored and indented like the code editor)?
> >
> There are many free SQL formatting tools out there, some better than others. I use the following (it does have issues
> and does not show properly all keywords especially SQL Server 2008 syntax, but does good formatting):
> http://www.simple-talk.com/prettifier/default.php
>
> --
> Plamen Ratchev
> http://www.SQLStudio.com
> .
>