


I make Microsoft SQL Server go faster. I love teaching, travel, cars, and laughing. I’m based out of Las Vegas. He/him. I teach SQL Server training classes, or if you haven’t got time for the pain, I’m available for consulting too.
Want to advertise here and reach my savvy readers?
44 Comments. Leave new
Please step away from the keyboard. Now.
Hee hee!
*In a French accent* Ozar? Did you say… Ozar?? *nervous tic begins…*
Come on, no UDT named NOLOCK?!
Bad idea 4
declare @ varchar(50) = ‘@@’, @@ varchar(50) = ‘@’
select @,@@, @ + @@
Daaaaang
Brent, you are a somewhat demented, twisted and bizarre man, but that’s funny!
Now set the batch separator to “NOLOCK”.
Some people just like to watch the world burn.
HAHAHA, that’s a great idea. I love it.
Nah, set it to _SELECT_ and watch people have screaming fits.
You cannot set NOLOCK as batch separator
Throw some linked servers into the mix for more glory.
Looks like the obfuscated SQL contest is starting up again. 🙂
I think I broke my brain.
*Checks date*
Nope, not 1 April…
I’m having a panic attack reading this
And that is why I have my 2AM rule: Write your code so that I can debug it when it breaks (inevitably) in the middle of the night.
Bozar the clown strikes again… 🙂 You made my day.
Ok that is such nerd DBA humor! I absolutely love it and got a good laugh. Thank you Brent!
What a wonderful idea! I’m using those in my next design. Yes, just shoot me now.
Why does no one else on my team find this as funny as I do?
Call it “Bizaro-base”.
I just remember a situation in the past
1-Select * from sometable where somefield IS NULL => Empty Result
2-Select * From sometable => Show somefield as null
I took some time to realize that shown NULL are in fact a text content of ‘NULL’
Rob Volk(@sql_r) has been pulling this shenanigans ever since I started going to SQL Saturdays and now they are letting him take his revenge at SQLBits this year. http://sqlbits.com/Sessions/Event12/Revenge_The_SQL
One of the funniest SQL Saturday sessions I have ever attended.
CREATE DATABASE #
GO
USE #
GO
CREATE SCHEMA #
GO
CREATE TABLE #.#(# VARCHAR(50))
GO
INSERT INTO #.#(#)
VALUES (‘#’)
GO
CREATE TABLE ###
(
# VARCHAR(50)
)
GO
INSERT INTO ###(#)
VALUES (‘#’)
GO
SELECT #.#, ##.# FROM #.#.# #
CROSS JOIN ### ##
Or perhaps an inner join
CREATE DATABASE #
GO
USE #
GO
CREATE SCHEMA #
GO
CREATE TABLE #.#(# VARCHAR(50))
GO
INSERT INTO #.#(#)
VALUES (‘#’)
GO
CREATE TABLE ###
(
# VARCHAR(50)
)
GO
INSERT INTO ###(#)
VALUES (‘#’)
GO
SELECT #.#, ##.# FROM #.#.# #
INNER JOIN ### ##
ON #.# = ##.#
–===============
— Bad Idea #5 —
–===============
CREATE DATABASE [[];
GO
USE [[];
GO
CREATE SCHEMA [[];
GO
CREATE TABLE [[].[[]([[] VARCHAR(50));
GO
SELECT [[].[[] FROM [[].[[].[[] [[]
GO
–===============
— Bad Idea #6 —
–===============
CREATE DATABASE “[]”;
GO
USE “[]”;
GO
CREATE SCHEMA “[]”;
GO
CREATE TABLE “[]”.”[]”(“[]” VARCHAR(50));
GO
SELECT “[]”.”[]” FROM “[]”.”[]”.”[]” “[]”
GO
HAHAHAHAHA, these are so awesome.
agreed! where’d you get them jeans? wait, don’t tell me…THE BAD IDEA OUTLET!
Using [[] or [[[[]] for the names and keeping the brackets for quoting makes the final select so much sexier:
SELECT [[[]]],[[[[[]]]]] FROM [[[]]].[[[]]].[[[]]]
–============================
— This could go on forever —
–============================
CREATE DATABASE [?];
GO
USE [?];
GO
CREATE SCHEMA [?];
GO
CREATE TABLE [?].[?]([?] VARCHAR(50));
GO
SELECT [?].[?] FROM [?].[?].[?] [?]
GO
The humor was lost due to insufficient unicode support, so a screenshot is required.
https://dl.dropboxusercontent.com/u/658609/ThisCouldGoOnForever.png
#1 reminds me of this scene from Being John Malkovich.
Must be writing for a new security system 🙂
CREATE DATABASE “”””;
GO
USE “”””;
GO
CREATE SCHEMA “”””;
GO
CREATE TABLE “”””.””””(“””” VARCHAR(50));
GO
INSERT INTO “”””.””””(“”””)
VALUES (‘”‘)
GO
SELECT “”””.”””” FROM “”””.””””.”””” “”””
GO
Brilliant! I must be a geek to find this so funny.
You missed an opporchancity to include yet another NOLOCK, thus:
SELECT NOLOCK NOLOCK FROM NOLOCK.NOLOCK.NOLOCK NOLOCK WITH (HOLDLOCK);
Alias the NOLOCK column as, well…NOLOCK. Also, I think it makes more sense to run in serializable isolation 🙂
+1 for HOLDLOCK!
O.M.G.! I’m in DBA nerd heaven!
couldn’t help but laugh! Nice one.
Well if I’m being honest, it’s not that much worse than the BAJILLIONS of uses that NOLOCK has been put to in the production databases around here.
Slightly related but just as maddening, a developer over here named a table IDDef_Log. Every time you try to type “ID”(which is basically all the time), intellisense jumps in if you’re not paying close attention and renames “ID” to “IDDef_log” and then you gotta go back and delete the extra characters . We basically curse him all day long!!
BD, if you haven’t seen it and don’t mind the profanity, this answer to the StackOverflow question “What is the best comment in source code you’ve ever encountered” should hit home: http://stackoverflow.com/a/184673/13495. I’m not inferring that the IDDef_Log creator was named Richard, but it sounds like you have lived in a place near this guy’s world.
Hahaha.
I don’t even want to imagine what prompted you to try this 🙂
BUFFALO BUFFALO BUFFALO BUFFALO BUFFALO