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

How to enable REGEXP_LIKE function on Azure SQL Server #382

Closed
vanderzielj opened this issue Apr 18, 2024 · 2 comments
Closed

How to enable REGEXP_LIKE function on Azure SQL Server #382

vanderzielj opened this issue Apr 18, 2024 · 2 comments
Labels
question Further information is requested

Comments

@vanderzielj
Copy link

I recently enabled some form validation using the REGEXP_LIKE database function on my forms and upon deployment to my DEV environment ran into some 500 server errors and the following entry in my logs:

2024-04-17T21:12:42.842019183Z django.db.utils.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot find either column "dbo" or the user-defined function or aggregate "dbo.REGEXP_LIKE", or the name is ambiguous. (4121) (SQLExecDirectW)')

After a couple of internet searches I learned that a) SQL Server does not natively support REGEXP_LIKE and b) this functionality was typically added to SQL Server for those who need it using CLR functions and finally that c) this functionality was also included with the mssql-django package.

Is this function installed and enabled by default on Azure SQL Server with the installation of the mssql-django package?
Can the installation be manually triggered either during or after the package has been installed?

Regards,

Justin

@vanderzielj vanderzielj added the question Further information is requested label Apr 18, 2024
@mShan0
Copy link
Contributor

mShan0 commented Apr 19, 2024

Hi @vanderzielj, there will have to be some manual setup to enable REGEXP_LIKE. We do it for our test databases so you can reference the file linked to use as a reference point on how to do so: https://github.com/microsoft/mssql-django/blob/dev/mssql/creation.py

@vanderzielj
Copy link
Author

Ok - that is what I suspected.

thanks,

Justin

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

No branches or pull requests

2 participants