In the database there are system tables we can use. We could get all objects that is created within a databasethe from sysobjects and we can get all the columns from table syscolumns. Here is a example to get a table's column name and type.
SELECT * FROM syscolumns S INNER JOIN sys.types T ON S.XTYPE = T.system_type_id WHERE S.id=object_id('Bills')
we also can get all the constraints.
SELECT * FROM sys.foreign_keys WHERE parent_object_id=object_id('Bills')
GO
SELECT * FROM sys.key_constraints WHERE parent_object_id=object_id('Packages')
GO
select * from sys.check_constraints
GO
select * from sys.key_constraints
GO
select * from sys.foreign_keys
GO
select * from sys.default_constraints
GO
SELECT * FROM sys.key_constraints WHERE parent_object_id=object_id('Packages')
GO
select * from sys.check_constraints
GO
select * from sys.key_constraints
GO
select * from sys.foreign_keys
GO
select * from sys.default_constraints