|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 11:03 AM
Points: 438,
Visits: 808
|
|
I've created an ADO.Net connection to a SQL 2005 instance and am using a Execute SQL Task to pass two parameters. FileName (ie. aadc_test) and FilePath (ie. \\\\remoteserver\\directory) to a procedure.
The first parameter is defined as string (255) and the second as string (1000) in both the task and the database has those fields as nvarchar(255) and nvarchar(1000) respectively.
When the procedure runs it will insert the filename and path into the database but ONLY THE FIRST CHARACTER. So I'll get "a" and "\" in my fields.
Can anyone tell me why I'm only getting the first character of my strings?
Thanks, Erin
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 1:10 PM
Points: 4,319,
Visits: 9,658
|
|
What are the parameters defined as in the stored proc definition?
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 3:19 PM
Points: 11,789,
Visits: 28,062
|
|
a parameter declared like DECLARE @var NVARCHAR or DECLARE @var2 VARCHAR has a size of ONE character...I think that's what Phil is going after...bad definition in the Stored procedure.
you would want to explicitly define the size, if that's the case. @var NVARCHAR(255) or whatever is appropriate.
Lowell
--There is no spoon, and there's no default ORDER BY in sql server either. Actually, Common Sense is so rare, it should be considered a Superpower. --my son
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 11:03 AM
Points: 438,
Visits: 808
|
|
Booyah, Lowell! You hit it. I forgot to define the size of my stored proc variables.
Good catch!
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 1:10 PM
Points: 4,319,
Visits: 9,658
|
|
Lowell (3/4/2013)
-- ..I think that's what Phil is going after...bad definition in the Stored procedure. --
It was indeed
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:01 PM
Points: 33,108,
Visits: 27,033
|
|
Erin Ramsay (3/4/2013) Booyah, Lowell! You hit it. I forgot to define the size of my stored proc variables.
Good catch!
IIRC, that maximum size for a DOS Path is 512 bytes. Not sure what it is for a UNC but I'd bullet proof the code a bit by making the variables on both ends with a width of at least 512 or maybe even 1024.
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|