Scripts

Technical Article

Stupid Coding Tricks: The T-SQL Mandelbrot

The bar for entry into CodeSOD is pretty straight forward: professionally-developed code that elicits that certain What The— reaction. Though there have been a few exceptions over the years, generally speaking, student code, hobbyist code, and amateur code need not apply. That said, I'd like to try something a little different today. Today's example is not technically professionally-developed, it's a Stupid Coding Trick.

"So I was bored at work one day," Graeme Job explains, "and wondered, what's the most useless thing I could do with my time without actually doing anything. Then it hit me. I could use T-SQL to generate... Mandelbrot."

Graeme continued, "Following is a single T-SQL SELECT statement that generates a text-representation of a Mandelbrot Set. The results are best viewed in text-mode."

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(19)

You rated this post out of 5. Change rating

2016-09-02 (first published: )

5,498 reads

Blogs

T-SQLTuesday 204: Are blogs still relevant?

By

This month’s blogging party is hosted by Jeff Ianucci – his challenge is to...

Are Blogs Still Relevant? I Think They Still Are.

By

As for me, I'll keep writing whenever time permits. I don't expect every post...

Reading Blogs: T-SQL Tuesday #204

By

This is an interesting invitation this month. Jeff Ianucci is a new host, and...

Read the latest Blogs

Forums

Pay for Performance

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Pay for Performance, which is...

Switching Schemas I

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Switching Schemas I

Enforcing Unique Customer Emails When Duplicates Already Exist

By Imran2629

Comments posted to this topic are about the item Enforcing Unique Customer Emails When...

Visit the forum

Question of the Day

Switching Schemas I

I run this query:

SELECT 
 s.name AS schemaname
 , o.name AS objectname
 FROM sys.objects o
 INNER JOIN sys.schemas s ON s.schema_id = o.schema_id
 WHERE o.name = 'Beer'
I get one row back for an object named dbo.beer. There is an ETL schema and both of these are nonpartitioned tables. I run this code:
ALTER TABLE dbo.beer switch TO etl.beer
What happens?

See possible answers