Hello,
I am looking for a data driven stored procedure that inserts data from one database to another. I will calling this stored proc once every 10 seconds to insert data. I can do this with TX replication but I want to avoid this because the source and destination
database will be on same server and also there is already transaction replication setup with distribution, subscription and publication on the same server.
These are 3 tables with foreign key dependencies. Here is DDL
CREATE TABLE [dbo].[ListedProcess]( [ID] [int] IDENTITY(1,1) NOT NULL, [TriggerId] [uniqueidentifier] NOT NULL, [ListedProcessStatusId] [int] NOT NULL, [ListedAt] [datetime] NOT NULL, [LastUpdatedAt] [datetime] NULL, [IsLiveMode] [bit] NOT NULL, [CallProcessId] [uniqueidentifier] NULL, [EmailProcessId] [uniqueidentifier] NULL, [TextProcessId] [uniqueidentifier] NULL, [NotificationTemplateId] [uniqueidentifier] NULL, [Size] [int] NOT NULL, [ResultsExported] [bit] NOT NULL, [JobCompletedEmailSent] [bit] NOT NULL, [SubStatusId] [int] NULL, [Preprocessor] [varchar](50) NULL, CONSTRAINT [PK_JobQueue] PRIMARY KEY NONCLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY] ) ON [PRIMARY] CREATE TABLE [dbo].[ListedProcessPerson]( [ID] [int] IDENTITY(1,1) NOT NULL, [ListedProcessID] [int] NOT NULL, [SourcePersonIndex] [int] NOT NULL, CONSTRAINT [PK_ListedProcessData] PRIMARY KEY NONCLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[ListedProcessPersonAttribute] Script Date: 7/27/2015 11:55:16 AM ******/ CREATE TABLE [dbo].[ListedProcessPersonAttribute]( [ID] [int] IDENTITY(1,1) NOT NULL, [ListedProcessPersonID] [int] NOT NULL, [SourceColumnIndex] [int] NOT NULL, [Value] [nvarchar](100) NOT NULL, CONSTRAINT [PK_ListedProcessPersonAttribute] PRIMARY KEY NONCLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[ListedProcessPerson] WITH CHECK ADD CONSTRAINT [FK_ListedProcessPerson_ListedProcess] FOREIGN KEY([ListedProcessID]) REFERENCES [dbo].[ListedProcess] ([ID]) GO ALTER TABLE [dbo].[ListedProcessPerson] CHECK CONSTRAINT [FK_ListedProcessPerson_ListedProcess] GO ALTER TABLE [dbo].[ListedProcessPersonAttribute] WITH CHECK ADD CONSTRAINT [FK_ListedProcessPersonAttribute_ListedProcessPerson] FOREIGN KEY([ListedProcessPersonID]) REFERENCES [dbo].[ListedProcessPerson] ([ID]) GO ALTER TABLE [dbo].[ListedProcessPersonAttribute] CHECK CONSTRAINT [FK_ListedProcessPersonAttribute_ListedProcessPerson] GO
Thanks for the inputs.