Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Procedure column size

Author  Topic 

keyursoni85
Posting Yak Master

233 Posts

Posted - 2011-09-29 : 06:46:51
I have one column in table with length of varchar 200
I also have defined 200 length in procedure of insertion

-- What if i pass 200+ characters to procedure from asp.net?
> Is it truncate other characters?

-- Also in some procedures column size applied more than actual size so in that case if I pass more size than column size and also sql procedure wrote with invalid size more that actual what should happen?

Is there any error generated for truncated error? or it will just truncate characters?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-29 : 08:01:00
it will truncate all characters which are > 200
in second case if stored proc parameter size is higher than table column size, it will throw error

string or binary data will be truncated

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2011-09-29 : 11:28:12
"-- What if i pass 200+ characters to procedure from asp.net?"

You may get an error from ASP.NET - depending how you are calling the stored procedure - i.e. your local variable exceeds the max size of the parameter.

If you are using dynamic SQL you will probably get no error
Go to Top of Page
   

- Advertisement -