Skip to content

Not sure how thoroughly this was tested on SQL Server, but I got a lot of errors with the included tool #24499

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

Open
lunny opened this issue May 3, 2023 · 2 comments
Labels

Comments

@lunny
Copy link
Member

lunny commented May 3, 2023

Not sure how thoroughly this was tested on SQL Server, but I got a lot of errors with the included tool and it appears to have some serious shortcomings (VARCHAR(MAX) doesn't work, and it doesn't quote the names). This is my modified query although I am still having errors due to unique index dependencies.

SELECT 'ALTER TABLE [' + OBJECT_NAME(SC.object_id) + '] ALTER COLUMN [' + SC.name + '] NVARCHAR(' +
CASE WHEN SC.max_length = -1 THEN 'MAX' ELSE CONVERT(VARCHAR(5), SC.max_length) END
+ ')'

FROM SYS.columns SC
JOIN SYS.types ST
ON SC.system_type_id = ST.system_type_id
AND SC.user_type_id = ST.user_type_id
WHERE ST.name ='varchar'

Originally posted by @edwardforgacs in #24105 (comment)

@lunny lunny changed the title Not sure how thoroughly this was tested on SQL Server, but I got a lot of errors with the included tool and it appears to have some serious shortcomings (VARCHAR(MAX) doesn't work, and it doesn't quote the names). This is my modified query although I am still having errors due to unique index dependencies. Not sure how thoroughly this was tested on SQL Server, but I got a lot of errors with the included tool May 3, 2023
@lunny lunny added the type/bug label May 3, 2023
@techknowlogick
Copy link
Member

@edwardforgacs could you provide the server version of MSSQL that you use?

@techknowlogick techknowlogick added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label May 3, 2023
@edwardforgacs
Copy link

It's SQL 2019 but this won't affect the syntax issues I mentioned.

@techknowlogick techknowlogick removed the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants