Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS source column update question?

$
0
0

Experts,

We have sample table as:-

CREATE TABLE #Address
(
	Add1	VARCHAR(30) NOT NULL,
	Lan		VARCHAR(10) NULL,
	Lon		VARCHAR(10) NULL
)

INSERT INTO #Address ( Add1 ) VALUES ( '123 Main St' )
INSERT INTO #Address ( Add1 ) VALUES ( '546 Main St' )

SELECT	*
FROM	#Address

DROP TABLE #Address

Now we have a SP where we need to pass OLEDB source column (Add1) as a parameter which returns back Lat & Lon columns:-

DECLARE @RC int
DECLARE @Addr1 varchar(500)
DECLARE @GC bit
DECLARE @Lat numeric(9,6)
DECLARE @Lon numeric(9,6)

SET	@Addr1 = ?--OLEDB Source column
SET @GC = 1;

EXECUTE @RC = usp_address
	  @Addr1
	 ,@GC
	 ,@Lat OUTPUT
	 ,@Lon OUTPUT

SELECT
	 @Addr1 AS Address1
	,@RC AS GoodAddress
	,@Lat AS Latitude
	,@Lon AS Longitude

Finally updated the @Lat & @Lon OUTPUT values of the SP back to the source columns of Lan & Lon respectively:-

UPDATE	#Address
SET		Lat = ?,
		Lon = ?
WHERE
	Addr = ?

Can anybody please help me with the best solution how to achieve above process?

Thanks

Kumar


Please do let us know your feedback. Thank You - KG, MCTS


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>