create type zip from integer NOT NULL
go
create default Zip_default as 528400
go
sp_helptext Zip_default
go
sp_bindefault 'Zip_default','zip'
go
create rule zip_rule as @number>100000 and @number<999999
go
sp_bindRule 'zip_rule','zip'
create table t (id integer not null,
zszip zip not null)
go
insert into t(id) values(1)
SELECT * FROM [practice].[dbo].[t]
if exists (select * from sys.tables where object_id=object_id('t') )
drop table t
GO