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