You are here: Re: ssis EXEC command « MsSQL Server « IT news, forums, messages
Re: ssis EXEC command

Posted by Erland Sommarskog on 08/21/07 21:24

(gelangov@hotmail.com) writes:
> I have 2 variables, one is the column name of the table and the other
> one is the table name and I need to write this in the "Execute SQL
> task" of a "For each loop" container in a ssis package like this:
>
> Truncate table <tableName>
> Insert into <tableName>
> Exec (' select [' + ?+ '] from '+ ?)
>
> It gives me error message when I try run the ssis. However if I put
> the above statements into a stored procedure and wrote look this, it
> works:
>
> spStroedproc ?, ?
>
> Do I need to change any of my settings for my "Exec" to work?

I don't know SSIS per se, but you can never parameterise on a table
name in SQL Server. You need to build the entire query string.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация