Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 SSIS/SQL Help

Author  Topic 

tooba111
Starting Member

22 Posts

Posted - 2014-05-15 : 20:45:14
Hi Guys,

I need help. Here is my Store Procedure, its a sample store procedure..


ALTER PROC [dbo].[USP_TestSP]
AS


SET FMTONLY OFF
SET NOCOUNT ON
if object_id('tempdb..##Temp1') is not null
DROP table ##Temp1


Select
Column1,
Column2,
Column3
Into ##Temp1
From Table1
Where DateRange Between '20140513' and '20140514'

Select * from ##Temp1

Insert Into TableB
(Column1,Column3)
Select Column1,Column3 from ##Temp1


SET NOCOUNT OFF


Here is the Problem. When I call this Store Procedure from SSIS. Its Inserting data twice or three times.Is anyone can help me. That would be big help for me.
Please let me know if u want to know more information.

Thank You,

Hommer
Aged Yak Warrior

808 Posts

Posted - 2014-05-20 : 14:53:57
I don't think you need a sp inside your ssis. All you need is a command like this


Insert Into TableB
(Column1,Column3)
Select Column1,Column3 From Table1
Where DateRange Between '20140513' and '20140514'



quote:
Originally posted by tooba111

Hi Guys,

I need help. Here is my Store Procedure, its a sample store procedure..


ALTER PROC [dbo].[USP_TestSP]
AS


SET FMTONLY OFF
SET NOCOUNT ON
if object_id('tempdb..##Temp1') is not null
DROP table ##Temp1


Select
Column1,
Column2,
Column3
Into ##Temp1
From Table1
Where DateRange Between '20140513' and '20140514'

Select * from ##Temp1

Insert Into TableB
(Column1,Column3)
Select Column1,Column3 from ##Temp1


SET NOCOUNT OFF


Here is the Problem. When I call this Store Procedure from SSIS. Its Inserting data twice or three times.Is anyone can help me. That would be big help for me.
Please let me know if u want to know more information.

Thank You,

Go to Top of Page

tooba
Posting Yak Master

224 Posts

Posted - 2014-05-22 : 00:09:15
Thank You for your reply, That was just a sample SP, that Insert Statement is part of SP, I can't use just a Insert Statement by its self.

Any one see this kind of error before?

Thank You.
Go to Top of Page
   

- Advertisement -