Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

passing long string into store procedure??

hi all

got a dilema here, I need to pass a string with variable length into a store procedure, if I set the intpu parameter to varchar(1000), it will handle most of the cases, since the input string is usually less 100 char, but in some particular case, the the input string will be longer than 1000 char, is there anyway to handle input parameter like that? or can I  just set it to the max length of the string allowed in sql server?


0
koo9
Asked:
koo9
  • 3
  • 2
1 Solution
 
koo9Author Commented:
sql_variant??
0
 
koo9Author Commented:
what will happen when passing a string longer than defined into a store procedure?

be trucated or an exception will be thrown?
0
 
rafranciscoCommented:
When passing a string longer than defined in a stored procedure, it will just be truncated.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rafranciscoCommented:
Might as well set the length of your parameter to the maximum length that you think will be passed to the stored procedure (maximum for SQL is varchar(8000)).
0
 
sudheeshthegreatCommented:
or you can define the parameter as TEXT.
0
 
rafranciscoCommented:
koo9, were we able to answer your question?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now