how to pass empty string as parameter
I have a parameter transactiondate defined as a string. When I created the job, I set up the parameter as " " - putting spaces in the paramater. when I go back to the job properties, that parameter is removed from the list, like it is not there. I need the parameter to remain and just pass a blank string? The reason I need this, as a normal run, the value will be blank but for a re-run I will update that parameter and put a date in it. I can't use a datetime field, as it defaults to a date and I can't have that happen. ANy ideas on why the parameter goes away in the sql server job area? Thanks
May 31st, 2011 4:48pm

Can you be more specific as to where you're taking these actions? This is an Integration Services forum, so we deal with SSIS related issues. If it's about SSMS or T-SQL, I can move this thread to a more appropriate venue... Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2011 6:10pm

Are you using a Stored Procedure? If so, just define your parameter as: CREATE PROC [usp_MyStoredProc] ( @TransactionDate VARCHAR(10) = '' ) AS ........ That way the parameter will be blank if you don't supply a dateJeff Wharton MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt) MCT, MCPD, MCITP, MCDBA Blog: Mr. Wharty's Ramblings Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
June 1st, 2011 12:31am

The issue is when I create the job in the sql server agent. I was trying to assign blanks to the parameter called tran date and after I inserted this under the "set values" section, and went back in, it was gone. The stored procedure works fine when the date is not entered (it handles the blank or null in my testing) , but the issue is if I want to do a re-run I would be settign a date to that parameter and if it is not there that will be more difficult to get accomplished. Is that normal behavior in sql server 2008 that if a parameter is blank, it gets removed from the list of parmeters in the set values section?
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2011 8:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics