TRUNCATE TABLE master..sysdatabases

...and other neat SQL Server tricks
posts - 55, comments - 60, trackbacks - 14

SyFy Channel Original Movie Title Generator

Saw this linked on reddit today and couldn't resist going through all the combinations:

create table #pre(name varchar(20))
create table #post(name varchar(20), pre varchar(10))

insert #pre select 'Dino' union all select
'Alien' union all select
'Shark' union all select
'Raptor' union all select
'Tractor' union all select
'Arachno' union all select
'Cyber' union all select
'Robo' union all select
'Choco' union all select
'Chupa' union all select
'Grizzly' union all select
'Mega' union all select
'Were' union all select
'Sabre' union all select
insert #post select 'dactyl','a' union all select
'pus','to' union all select
'conda','a' union all select
'droid',null union all select
'dile','o' union all select
'bear',null union all select
'vampire',null union all select
'squito',null union all select
'saurus','a' union all select
'wolf',null union all select
'ghost',null union all select
'viper',null union all select
'cabra','a' union all select
'yeti',null union all select
select +
case when right(,1) not like '[aeiouy]' and b.pre is not null then b.pre else '' end +
from #pre a cross join #post b
where<> -- optional, to eliminate the "SharkShark" option
order by 1

Which one is your favorite?  I like most of the -squito versions, especially Chupasquito and Grizzlysquito.

Print | posted on Wednesday, May 26, 2010 12:45 PM |



# re: SyFy Channel Original Movie Title Generator

I'm only ever going to need to name 1 movie, so I changed the select query to just output 1 name at random (sort of).

select Top 1 +case when right(,1) not like '[aeiouy]' and b.pre is not null then b.pre else '' end
from #pre a
cross join #post b
-- optional, to eliminate the "SharkShark" option
order by NEWID()
5/26/2010 6:13 PM | Robert L Davis

# re: SyFy Channel Original Movie Title Generator

like '%yeti'
5/27/2010 12:53 PM | Chuckarama
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET