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

Breaks on Azure SQL Db "sys.sp_addextendedproperty" #28

Open
12c4IT opened this issue Apr 14, 2015 · 5 comments
Open

Breaks on Azure SQL Db "sys.sp_addextendedproperty" #28

12c4IT opened this issue Apr 14, 2015 · 5 comments
Milestone

Comments

@12c4IT
Copy link

12c4IT commented Apr 14, 2015

Hi Tim,

If you try and use it when deploying to Azure you will get the error "Could not find stored procedure 'sys.sp_addextendedproperty'. " (Azure SQL does not support this).

It looks as though you are only using this proc to add the "Automatically generated..." description. Could we add this as an option? So we can turn it off if deploying to Azure?

I downloaded code and removed the lines that add the description and tested deploying to Azure and works.

https://github.com/timabell/ef-enum-to-lookup/blob/master/EfEnumToLookup/LookupGenerator/SqlServerHandler.cs#L64-L65

Thanks.

@timabell
Copy link
Owner

Well that's rather annoying! shame on microsoft for not supporting documentation any more.

It might be better if the generated sql were to detect that it's running on sql rather than require the dev to know about this quirk. I'll take a look when I get a moment. If you'd like to do a pull request let me know and I'll hold off so we don't duplicate the effort.

Thanks for reporting this.

@12c4IT
Copy link
Author

12c4IT commented Apr 15, 2015

I'm happy to look at it. Just not sure what the best approach would be?

Possibly using DbContext to open a connection and determine the version inside your GetDbHandler method? Not sure how this would affect MariaDB etc for your future enhancements?

@timabell
Copy link
Owner

I'd want to do it in pure SQL because the library now supports generating a migration sql script for a DBA to run.

Note to self: http://stackoverflow.com/questions/1375934/how-can-i-detect-which-version-of-sql-eg-sql-2008-or-sql-azure

@timabell
Copy link
Owner

I seem to be rather short on time at the moment.

@timabell
Copy link
Owner

http://stackoverflow.com/q/12458292/10245 - how to document schema for azure (you don't, ffs microsoft) so we're down to detecting if that proc exists and only using it if it does.

  • Given that the generated sql may be run by a dba the detection has to happen within the generated sql.
  • I don't want to just detect that it is azure in case microsft add/remove this proc from various versions of sql server in the future.

Ask the internet: http://dba.stackexchange.com/q/98867/33693

@timabell timabell added this to the v2 milestone Jul 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants