i need a script to script all the database object (like tables,sp,view).....like
IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[fnSplit]')
AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[fnSplit]
GO
/****** Object: UserDefinedFunction [dbo].[fnSplit] Script Date: 12/14/2009
15:14:23 ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[fnSplit].......
it will also drop all constraint .....i need a complete package i am aware of tools like scriptio,SQL Management studio(where only one can be selected either create or drop)