Groups | Blog | Home
all groups > sql server dts > march 2007 >

sql server dts : Rowcount in SSIS 2005


Mitch
3/19/2007 10:18:03 AM
Hello, I am trying to insert a row count into a log table after a bulk insert
is performed. I have put in the Row Count transformation task, storing the
value in a user variable, RowCount. At the end of the bulk insert, I am
executing T-SQL, creating an index, other stuff, and then I want to insert
this RowCount into a Log table. When I run the package, I get this error:

insert into LoadCCSCodeTableLog (NumRecords,EndDate) values
(@RowCount,getdate())
" failed with the following error: "Must declare the scalar variable
"@RowCount".". Possible failure reasons: Problems with the query, "ResultSet"
property not set correctly, parameters not set correctly, or connection not
established correctly.

Help?
Darren Green
3/19/2007 9:17:19 PM
You need to use ? as the parameter placeholder then map the parameter to the
variable in SSIS. Local variables in SQL, such as @MyVar, do not
automatically map to variables in SSIS. The Parameter Name will be 0, the
index of the ? in the statement.

Some examples - http://www.sqlis.com/58.aspx



The SSIS newsgroup (microsoft.public.sqlserver.integrationsvcs) would be a
better place for SSIS questions going foward.

--
Darren Green
http://www.konesans.com | http://www.sqlis.com | http://wiki.sqlis.com
[quoted text, click to view]
AddThis Social Bookmark Button