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

fix case of sp_MSforeachtable #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mulhollandms
Copy link

@mulhollandms mulhollandms commented Aug 21, 2020

Found this while trying to use loaddata. If the database is using a case-sensitive collation, then operations that disable check constraints will fail because the stored procedure 'sp_msforeachtable' can't be found. Changing the case to 'sp_MSforeachtable' resolves the issue.

@mulhollandms mulhollandms marked this pull request as ready for review August 21, 2020 16:31
@MrVhek
Copy link

MrVhek commented Sep 15, 2020

Hello, I'm curious of how you did manage to make it work ? My Azure SQL Database freshly created does not know either "sp_MSforeachtable" or "sp_msforeachtable". Did you add it manually ? Thanks in advance.

@mulhollandms
Copy link
Author

So, from what I found when I first stumbled onto this, it seems there's a discrepancy between Azure SQL and other versions of SQL Server. Since sp_MSforeachtable is an undocumented proc, I don't think it ever got ported into Azure SQL. If you're using Azure SQL, you'll probably have to add it manually.

This thread has some more details: https://stackoverflow.com/questions/46651612/deploy-database-to-azure-sql-fails-sp-msforeachtable-not-found

@MrVhek
Copy link

MrVhek commented Sep 15, 2020

Ok thanks, so you are not using Azure SQL Database. Thanks for your help.

@ramusus
Copy link

ramusus commented Apr 26, 2021

This fix works for us, thanks

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

Successfully merging this pull request may close these issues.

3 participants