Testing AI with ASCII Jack-o-Lanterns

I was thinking about new ideas for Halloween-related blog posts. I’ve written about the Halloween problem and ghost records. Somehow I ended up wondering how different AI assistants would handle creating a SQL query to generate an ASCII jack-o-lantern. So just for fun, here are the results for the prompt:

Create a SQL Server script that generates an ASCII jack-o-lantern when a query sends results to text.

Copilot

Spooky, but not for the right reasons.

Gemini

The result resembles a cat instead of a jack-o-lantern but when executing the script it looks more like gibberish.

Claude

The SQL script is definitely more thorough:

-- SQL Server ASCII Jack-o'-lantern Generator
SET NOCOUNT ON;

DECLARE @JackOLantern TABLE (
    LineNum INT IDENTITY(1,1),
    Line VARCHAR(50)
);

-- Insert the ASCII art lines
INSERT INTO @JackOLantern (Line)
VALUES 
    ('          ,////,'),
    ('         /// 6|'),
    ('         //  _|'),
    ('        _/_,-'''''),
    ('   _.-/////    '),
    (' ,''' ////      '),
    ('(    /''''\      '),
    (' \  (    |   |  '),
    ('  \  \   | . |  '),
    ('   \  \  |   |  '),
    ('    ) /''/   /   '),
    ('   / / /   /    '),
    ('  / / /   /     '),
    (' (,(_/   /      '),
    ('  \     /       '),
    ('   `'''''''`        ');

-- Create a function to wrap the results
CREATE OR ALTER FUNCTION dbo.WrapWithJackOLantern(@ResultText NVARCHAR(MAX))
RETURNS TABLE
AS
RETURN (
    SELECT Line
    FROM @JackOLantern
    UNION ALL
    SELECT '------------------------'
    UNION ALL
    SELECT @ResultText
    UNION ALL
    SELECT '------------------------'
);

-- Example usage:
-- Replace this with your actual query
SELECT *
FROM dbo.WrapWithJackOLantern('Happy Halloween!') AS Results;

-- More complex example with multiple results
WITH SampleData AS (
    SELECT 'Trick or Treat!' AS Message
    UNION ALL
    SELECT 'Boo!'
)
SELECT r.Line
FROM SampleData s
CROSS APPLY dbo.WrapWithJackOLantern(s.Message) r;

-- Cleanup (optional)
-- DROP FUNCTION IF EXISTS dbo.WrapWithJackOLantern;

More is not better as running the code doesn’t get very far:

Carved Up

For those who create jack-o-lanterns professionally using SQL Server, you can rest easy knowing AI hasn’t caught up quiet yet.

                                              _
                              /\              )\
                _           __)_)__        .'`--`'.
                )\_      .-'._'-'_.'-.    /  ^  ^  \
             .'`---`'. .'.' /o\'/o\ '.'.  \ \/\/\/ /
            /  <> <>  \ : ._:  0  :_. : \  '------'       _J_
            |    A    |:   \\/\_/\//   : |     _/)_    .'`---`'.
            \  <\_/>  / :  :\/\_/\/:  : /   .'`----`'./.'0\ 0\  \
           _?_._`"`_.'`'-:__:__:__:__:-'   /.'<\   /> \:   o    |
        .'`---`'.``  _/(              /\   |:,___A___,|' V===V  /
       /.'a . a  \.'`---`'.        __(_(__ \' \_____/ /'._____.'
       |:  ___   /.'/\ /\  \    .-'._'-'_.'-:.______.' _?_
       \'  \_/   |:   ^    |  .'.' (o\'/o) '.'.     .'`"""`'.
        '._____.'\' 'vvv'  / / :_/_:  A  :_\_: \   /   ^.^   \
                  '.__.__.' | :   \'=...='/   : |  \  `===`  /
               jgs           \ :  :'.___.':  : /    `-------`
                              '-:__:__:__:__:-'

                    

Credit to asciiart.website for the Jack-o-lanterns above.

Thanks for reading and Happy Halloween!

Leave a comment