Closed jay-dev-9 closed 3 years ago
Sequence names cannot be treated as parameters in ADO.NET. Use the raw parameter for this case.
SELECT NEXT VALUE FOR /*@ sequence */sample
SELECT NEXT VALUE FOR /*# sequence */sample
SELECT NEXT VALUE FOR /@ sequence /sample => it works in postgresql, not working in sql server. SELECT NEXT VALUE FOR /# sequence /sample => Ok in sql server
i don't know how it works
That's the difference between the implementations of each ADO.NET Data Provider. Even when using other libraries, SQL Server will use strings instead of parameters. Raw parameter version also works with PostgreSQL, so if you want to write it the same way, use raw parameter.
I can see that, thank you
Hi Usausa,
I execute the code and get the error as below: