You can use some code like this to get the CREATE statements for views, sprocs, etc. (but not tables)set nocount ondeclare @str varchar(100),@id intdeclare c cursor for select name,id from sysobjects where xtype = 'V'open cfetch next from c into @str,@idwhile @@fetch_status = 0 begin select @str as name, text from syscomments where id = @id fetch next from c into @str,@id endclose cdeallocate cset nocount off
You can of course modify it to turn it into a sproc that outputs only for specifice objects.Sarah Berger MCSD