How to view the definition of a sequence?

679 Views Asked by At

I want to retrieve the definition of a sequence through a query. I have already done this with triggers:

USE dbName 
SELECT c.text FROM sys.syscomments c 
INNER JOIN (
    SELECT object_id FROM SYS.triggers WHERE name = 'triggerName'
) t ON c.id = t.object_id
1

There are 1 best solutions below

0
ErikEJ On

You can see information about all sequences like this:

SELECT * FROM sys.sequences