Hi
I have a database that it is not me who created it.
I have a field in one table that is declared as ntext with a length of 16. I thought it was as a nvarchar(16) but I can see record in it with more than 16 characters..
Thanks in advance
ntext is used to store unicode character data of more than 4000 characters. The length refers to the number of bytes rather than the number of characters.
If you don't need to store more than 4000 characters then I would use nvarchar(4000). It is a lot easier to work with than the binary (text, ntext, image) data types.
Also, if you don't need to store unicode data then varchar columns can hold up to 8000 characters.
ohhhh!
Is it why I can not declare a parameter in a stored procedure ntext? If I have to use that type of data in my database and I want to declare a variable that can hold its value...how should I declare my variable?
Thanks in advance
James
I tried to put this parameters in my StoredProcedure
but it doesn't work:
@NoteContent ntext(16)
I've got an error message as follow
Error 2716: Column or parameter #5: Cannot specify a column width on data type ntext. Parameter '@NoteContent' has an invalid data type.
RSX02m James is saying that you cannot declare a NTEXT variable in your stored procedure but you can have a stored procedure parameter declared as NTEXT.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.