Link to home
Create AccountLog in
Avatar of HopeQ
HopeQ

asked on

How to query constraints in Sybase

I have following query works for SQL Server. Can someone help me translate it to Sybase?
USE database_name;
GO
SELECT OBJECT_NAME(OBJECT_ID) AS NameofConstraint,
SCHEMA_NAME(schema_id) AS SchemaName,
OBJECT_NAME(parent_object_id) AS TableName,
type_desc AS ConstraintType
FROM sys.objects
WHERE type_desc LIKE '%CONSTRAINT'
GO
Avatar of PortletPaul
PortletPaul
Flag of Australia image

change 'sys.objects' to 'sysobjects'

also then look at the fieldnames, here:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc36271_36272_36273_36274_1250/html/refman/X14933.htm

and other system tables are also documented there.

ps: don't have access to Sybase myself I'm afraid
SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.