Here is the cmd for running the sql files
Ended up using ScriptDb.exe or you could use SSMS . On windows 7 and sql server 2008 did not build correctly at the beginning. Had to find the appropriate dll's to build it first ...
ScriptDb.exe -con:server=(local);trusted_connection=yes -outDir:. -ScriptAllDatabases -Permissions -Purge
and than copying just the files of the needed objects:
SELECT distinct
'COPY D:\Temp\Temp\DBNAME\Programmability\StoredProcedures\' +
ObjectName + '.sql D:\temp\temp\DBNAME\1.2.8\StoredProcedures\'
+ ObjectName + '.sql'
FROM tbDataMeta_ChangeLog
where ObjectType = 'PROCEDURE'
AND EventDate>'2010-02-10'
USE [MY_DB]
GO
IF EXISTS (SELECT * FROM dbo.sysobjects
WHERE id = OBJECT_ID(N'[DF_EventsLog_EventDate]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[DbObjectsChangeStore] DROP CONSTRAINT [DF_EventsLog_EventDate]
END
GO
USE [MY_DB]
GO
/****** Object: Table [dbo].[DbObjectsChangeStore]
Script Date: 02/11/2010 17:58:00 ******/
IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[DbObjectsChangeStore]') AND type in (N'U'))
DROP TABLE [dbo].[DbObjectsChangeStore]
GO
USE [MY_DB]
GO
/****** Object: Table [dbo].[DbObjectsChangeStore]
Script Date: 02/11/2010 17:58:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DbObjectsChangeStore](
[LogId] [int] IDENTITY(1,1) NOT NULL,
[DatabaseName] [varchar](256) NOT NULL,
[EventType] [varchar](50) NOT NULL,
[ObjectName] [varchar](256) NOT NULL,
[ObjectType] [varchar](25) NOT NULL,
[SqlCommand] [varchar](max) NOT NULL,
[EventDate] [datetime] NOT NULL,
[LoginName] [varchar](256) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DbObjectsChangeStore]
ADD CONSTRAINT [DF_EventsLog_EventDate]
DEFAULT (getdate()) FOR [EventDate]
GO
IF EXISTS (SELECT * FROM sys.triggers
WHERE parent_class_desc = 'DATABASE' AND name = N'trig_BackUpDbObjects')
DISABLE TRIGGER [trig_BackUpDbObjects] ON DATABASE
GO
USE [MY_DB]
GO
/****** Object: DdlTrigger [trig_BackUpDbObjects]
Script Date: 02/11/2010 17:58:49 ******/
IF EXISTS (SELECT * FROM sys.triggers
WHERE parent_class_desc = 'DATABASE'
AND name = N'trig_BackUpDbObjects')
DROP TRIGGER [trig_BackUpDbObjects] ON DATABASE
GO
USE [MY_DB]
GO
/****** Object: DdlTrigger [trig_BackUpDbObjects] Script Date: 02/11/2010 17:58:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create trigger [trig_BackUpDbObjects]
on database
for create_procedure, alter_procedure, drop_procedure,
create_table, alter_table, drop_table,
create_function, alter_function, drop_function
as
set nocount on
declare @data xml
set @data = EVENTDATA()
insert into [dbo].[DbObjectsChangeStore](databasename, eventtype,
objectname, objecttype, sqlcommand, loginname)
values(
@data.value('(/EVENT_INSTANCE/DatabaseName)[1]', 'varchar(256)'),
@data.value('(/EVENT_INSTANCE/EventType)[1]', 'varchar(50)'),
@data.value('(/EVENT_INSTANCE/ObjectName)[1]', 'varchar(256)'),
@data.value('(/EVENT_INSTANCE/ObjectType)[1]', 'varchar(25)'),
@data.value('(/EVENT_INSTANCE/TSQLCommand)[1]', 'varchar(max)'),
@data.value('(/EVENT_INSTANCE/LoginName)[1]', 'varchar(256)')
)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
DISABLE TRIGGER [trig_BackUpDbObjects] ON DATABASE
GO