BUG - NewSequentialId() is not supported
MattOG
Posts: 8 New member
in SQL Prompt
Hi,
Defining a default with newsequentialid() results in SqlPrompt surrounding it with square brackets, causing invalid code.
The desired behaviour is the same as NewID().
Unformatted code:
Defining a default with newsequentialid() results in SqlPrompt surrounding it with square brackets, causing invalid code.
The desired behaviour is the same as NewID().
Unformatted code:
CREATE TABLE [dbo].test (
IdOne UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID()
,IdTwo UNIQUEIDENTIFIER NOT NULL DEFAULT NEWSEQUENTIALID()
)
Formatted code:
Formatted code:
CREATE TABLE [dbo].[test] (
[IdOne] UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID()
,[IdTwo] UNIQUEIDENTIFIER NOT NULL DEFAULT [NEWSEQUENTIALID]()
)
Thanks
Thanks
Tagged:
Best Answer
-
Alex B Posts: 1,158 Diamond 4
Hi @MattOG ,
Unfortunately SQL Prompt doesn't officially support Azure (though some parts may work, it's not officially listed on the Requirements page as supported https://documentation.red-gate.com/sp/getting-started/requirements).
The product manager has made a comment in this thread (https://forum.red-gate.com/discussion/comment/158578/#Comment_158578) regarding this.
We have recorded the issue for when this work begins. I will try to update here in the future when the work on Azure begins!
Kind regards,
Alex
Answers
What version of SQL Prompt are you seeing this in? I've just tried in 9.5.20 and .21 and it doesn't add the square brackets around it for me.
Kind regards,
Alex
Have you visited our Help Center?
I'll share the version and maybe my settings file (?) when I get home and can check. I have the option to surround aliases etc checked too.
Matt
If you go into SQL Prompt > Options > Special characters
: Enable "Enclose identifiers within square brackets"
Also SQL Prompt > Options > Styles
: Enable "Add/remove square brackets
: Select "Add brackets to all identifiers"
The behaviour will then be present.
I'm still not able to reproduce this. I've tried in 18.3 and 17.9.1 against different SQL versions and tried toggling other different SQL Prompt options and styles but it's still working correctly for me in 9.5.21.
Are able to share the Prompt.settings file and the .sqlpromptstylev2 files? If needed I can reach out to you via a support ticket to retrieve the files.
Kind regards,
Alex
Have you visited our Help Center?
Yes ok I'll go via the support ticket route, although I can't imagine there's anything private in those files, it'll at least get a ticket open to track the issue.
I'll open one as soon as I've posted this and attach the files there.
Thanks.