Skip to content
Advertisement

Get Sequence Current Value

I have a created sequence on my DB Server, used for generated registers and the detail of every one. I have to create a plain document of that detail in the moment of the generation, so I have to retrieve the current value of the sequence (not the NEXT)

I’m generating a query for get the desired data, but I need (as I said) get the current value of the sequence

— this is my sequence:

— and this is my SP for retriving data

But my problem is: “Implicit conversion of the data type sql_variant to int is not allowed”

How can I get the current value of my sequence? Should I use: select max (id_guiaRemision) from my table? (not seems efficient) Please, I hope any one can help me.

Best regards

Advertisement

Answer

Could you try this?

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement