Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert DDL to Snowflake - Not an issue any more, just some code others might benefit from. #38

Closed
jmadison222 opened this issue Mar 17, 2024 · 3 comments

Comments

@jmadison222
Copy link

jmadison222 commented Mar 17, 2024

Scott:

Love your product! But forget this request. Short version, I use Snowflake, and I need to make some tweaks to get it there, but I'm good.

For reference, here is what I run to get on Snowflake:

        #
        # Convert SQL Server to Snowflake.
        #
        sed -i 's/SET NOCOUNT ON;//g' puzz.sql     # Directive at the top.
        sed -i 's/\[/\"/g' puzz.sql                # Replace opening bracket.
        sed -i 's/\]/\"/g' puzz.sql                # Replace closing bracket.
        sed -i 's/, Year)/, "Year")/g' puzz.sql    # One more in the PK clause.
        sed -i 's/^GO$//g' puzz.sql                # SQL Server's "Go" command.
        sed -i 's/MONEY/DECIMAL(38,4)/g' puzz.sql  # Change MONEY to DECIMAL.
        sed -i 's/USE test;//g' puzz.sql           # Stay in one database.
        sed -i 's/MAX/4000/g' puzz.sql             # Really big string.

Thanks!

James

@jmadison222 jmadison222 changed the title Rename columns to remove brackets so Snowflake works better. Convert DDL to Snowflake - Not an issue any more, just some code others might benefit from. Mar 17, 2024
@smpetersgithub
Copy link
Owner

smpetersgithub commented Mar 19, 2024 via email

@jmadison222
Copy link
Author

That would be great if you did the column rename. Also, I have a number of other observations for a number of questions around ambiguities and edge cases. As the months and years go by, I can submit some to you if you want.

Not trying to make work if this is just a hobby, etc. But I study and work the problems carefully, so I'm happy to send along my thoughts on what might be good improvements. Then you can do with them what you will.

Thanks!

James

@smpetersgithub
Copy link
Owner

smpetersgithub commented Mar 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants