Showing posts with label request. Show all posts
Showing posts with label request. Show all posts

Friday, March 9, 2012

OnVariableChangedEvent Log Message

I have posted a very simple request to have the message in the SSIS log from an OnVariableValueChanged Event to include the vale the variable has been set to.

If you like the idea of this enhancement please go and vote and validate it here

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=238803

Phil,

What does it have in there currently?

-Jamie

|||Just the name of the variable that changed

Wednesday, March 7, 2012

only one character added to database instread of full data string?

When I execute this, it works ok but only one the first character of the request.form["d"] is stored to the db.

I checked the sproc with another routine and it adds full data, and I've verified that value of request.form["d"] is longer than one chaacter by printing it to the page. Anyone got any ideas why only the first char is getting added to the db??


SqlConnection SqlConnection1 =new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString1"].ConnectionString);SqlCommand SqlCommand1 =new SqlCommand("addRoute", SqlConnection1);SqlCommand1.CommandType = CommandType.StoredProcedure;SqlParameter SqlParameter1 = SqlCommand1.Parameters.Add("@.ReturnValue", SqlDbType.Int);SqlParameter1.Direction = ParameterDirection.ReturnValue;SqlCommand1.Parameters.Add("@.xmlData", Request.Form["d"]);SqlConnection1.Open();SqlCommand1.ExecuteNonQuery();Response.Write(SqlCommand1.Parameters["@.ReturnValue"].Value);//Response.Write(Request.Form["d"]);

Here's my stored procedure too....

CREATE PROCEDURE [mydatabase].[addRoute]@.xmlDatavarcharASSET NOCOUNT ONINSERT INTO tbl_routes(xmldata)VALUES(@.xmlData)SELECT scope_identity()RETURN scope_identity()SET NOCOUNT OFF

|||

You need to set the size of the parameter. By default it takes only one character.

@.xmlDatavarchar(50)