-
Notifications
You must be signed in to change notification settings - Fork 108
tsqlt.DropClass can't deal with some special characters in class names #5
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
Comments
Proposed solution to issue tSQLt-org#5
Try wrapping the schema name in [brackets]. That should take care of your Thanks, Sebastian On Fri, Jul 15, 2016 at 4:28 PM, Prof-hu notifications@github.com wrote:
|
Unfortunately that doesn't work either, I tried. That way SCHEMA_ID(PARSENAME(@classname,1)) works out, but SCHEMA_ID(@classname) doesn't. Therefore the procedure fails, as it will not find and drop the objects in the schema before trying to drop the schema itself. Unless the schema didn't have any objects in it, of course. |
That is then a problem. I will look into it. |
Thanks! |
Another proposal for issue tSQLt-org#5
Any update on this? Would be nice to have this fixed, so that I wouldn't need to apply workarounds in my projects. |
I had trouble with using DropClass while trying to figure out some standardized naming conventions for Class (test schema) names. The issue is there when there is a dot (ASCII 46) in the name.
Looking at the code of the procedure I noticed that when it is looking for the schema id, it uses SCHEMA_ID(@classname) everywhere, expect where it looks up the schema itself from sys.schemas. There it is using SCHEMA_ID(PARSENAME(@classname,1)). Not sure what's the goal with this, but once there's a dot in the Class name, PARSENAME will keep only the part after it, and SCHEMA_ID will not find the schema.
The text was updated successfully, but these errors were encountered: