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

OLE DB Destination SQL Command Data Acess Mode Mapping Problem

$
0
0

Hi Everyone, I'm very very new to SSIS and need some help.

I copy the code below into SQL cmmand text of the SSIS OLE DB Destination Editor with access mode of SQL command.
The preview works. However, the mapping isn't correct. The available Input Columns are good but
the available destination column has only one field, TABLE_Name, from the first select below. I want to map to the column 1, column 2...

What can I do to get this to work? I hope it's something simple and just overlooked. Right now I'm Pulling my hair out.

I'm using VS 2005.

declare @SQL nvarchar(max),@SQL1 nvarchar(max) 

--get the last table name that was create in database
Select @SQL =

(SELECT TOP (1) TABLE_NAME
FROM   LCP_CRM.information_schema.tables
WHERE (TABLE_NAME LIKE 'Accounting_EdProgReg_%')
order by TABLE_NAME desc)    

-- create the sql using last filename
Select @SQL1 =
 
 'Select [Column 0]
      ,[Column 1]
      ,[Column 2]
      ,[Column 3]
      ,[Column 4]
      ,[Column 6]     
       from ' + 'LCP_CRM.dbo.' + @SQL
     
EXEC (@SQL1)

Tom


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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