Need An Unlimited Length Char Field

Dec 7, 1998

Hi,

If I want to make a field of characters to be unlimited length(or maybe 2k for example), what datatype should I use?
Char, varchar and text have a max. limit of 255...

Will appreciate any suggestions.

Thanks,
Nishi

View 4 Replies


ADVERTISEMENT

Unlimited Number Of Characters In A Field

Feb 4, 2005

Hello,

I am developing a message board using ASP on IIS and SQL Server 2000, and I am running into a problem.

When a user enters their post, they enter their user name, subject, and of course all of their post content. Now the post content should be an unlimited number of characters since it could end up being multiple paragraphs.

I know I could just use an ASP file system object and write the text to a file, but I wanted to save all of these paragraphs as a field in a database table so I could pull it from the database so it could be edited by the user.

Is there a way to make a field be able to take in an unlimited amount of characters?

Or is this the wrong way to do things; is it bad to have an unlimited amount of characters in a table field? Should I stick to using the ASP System File Object?

View 1 Replies View Related

Why Specify The Char Length In Varchar?

Feb 6, 2002

Newbie question:

Why bother specifing the length in varchar()?
Why not just specify the max and not worry about truncation?

Thanks,

Martin

View 2 Replies View Related

Can Varchar Length Be Set To More Than 8000 Char?

May 22, 2006

Hi, everyone, I want to know is there a way for me to set varchar to store more than 8000 characters? (I did checked from sql server books online and i know that the maximum storage for varchar, but i just want to know is there any exceptional way for me to store more than that).

Thanks for any reply.

aex

View 4 Replies View Related

Changing Char Length In Stored Procedures

Aug 11, 2004

Hello all, I'm using SQL Server 2000 and have about 250 stored procedures that use an EMPLID parameter or variable of type varchar with a length of 4. I need to change the length to 10 instead and would like to do so without having to open every sp for editing. Is there a way to do this through SQL Server 2000? Does anyone have a script to do this? Any help would be appreciated.

View 1 Replies View Related

Converting Int To Fixed Length Char With Leading Zeroes

May 25, 1999

Hello All,
Can someone tell me how (in SQL) to convert an integer to a fixed length character filled with leading zeros. For example, I have an integer value of '125'. My user wants to see it displayed as '00000125'. How do I get the zeroes to fill in to a char(8) field when the length of the value differs, ie. '1', '125', '3452', etc.

Thanks in advance,
Terry

View 1 Replies View Related

Store Phone Numbers/Zip Codes As Char(length) Or Numeric Datatypes?

Dec 18, 2003

I'm wondering which way is the best way to store your numeric values.
It probably doesnt matter, b/c you can always convert back and forth...but i'm just wondering what the best practice is i guess...


thx

View 1 Replies View Related

Odbc - Binding Sql Server Binary Field To A Wide Char Field Only Returns 1/2 The Daat

Jul 23, 2005

Hi ,Have a Visual C++ app that use odbc to access sql server database.Doing a select to get value of binary field and bind a char to thatfield as follows , field in database in binary(16)char lpResourceID[32+1];rc = SQLBindCol(hstmt, 1, SQL_C_CHAR,&lpResourceID,RESOURCE_ID_LEN_PLUS_NULL , &nLen1);and this works fine , however trying to move codebase to UNICODE antested the followingWCHAR lpResourceID[32+1];rc = SQLBindCol(hstmt, 1, SQL_W_CHAR,&lpResourceID,RESOURCE_ID_LEN_PLUS_NULL , &nLen1);but only returns 1/2 the data .Any ideas , thoughts this would work fine , nit sure why loosing dataAll ideas welcome.JOhn

View 2 Replies View Related

Transact SQL :: NVARCHAR Field Getting Truncated After Increasing Field Length?

Aug 28, 2015

I have a very strange situation. I've increased the size of an NVARCHAR field from 8 to 9 in a database table. The format of the data that I enter will either be an 8 character field (123456-8) or a 9 character field (1234567-9). The '-' is critical.

It used to only accept the 8 character version, but after increasing the field size, if I try to insert the 9 character field version, it gets truncated after the '-', as though it's still only allowing 8 characters. But that only occurs when I include the '-' or other such characters like '#'. If I try to insert 1234567a9, it works. The following explains the outcomes:

Inserted Value -> Result in table

123456-8 -> 123456-8      *Correct
1234567-9 -> 1234567-     *Wrong
123456789 -> 123456789    *Correct
1234567#9 -> 1234567#     *Wrong
1234567a9 -> 1234567a9    *Correct

Why is it that characters such as '-' and '#' are truncating the value, but only if the string is 9 chars long?

I'm currently using a direct t-sql insert statement in SQLExpress. The field is a simple NVARCHAR(9) field.

View 3 Replies View Related

Convert Var Char Field To Date Field

Sep 27, 2005

Hi,

I need to convert a var char field to date field (DD/MM/YYYY)

Current convertion format:
CAST(Report_Date as DATETIME)

How can i convert to Date field with date format of DD/MM/YYYY?

Thanks.

Onn Onn

View 2 Replies View Related

Pad Char(2) Field With Zero

Apr 6, 2006

Hi

I'm extracting a char(2) field from a table that has a value of '1' and writing it to another table but want the output field to be padded with a zero. I have tried this below:

right('00' + isnull(Field1, ' '),2

but the output field comes out as '1 ' (that's 1 followed by a space). Does anyone have any idea how I can do this or please point out what I'm doing wrong in my 'right(' fucntion above.
Thanks,
Jeff

View 3 Replies View Related

Converting An INT Field To CHAR

Oct 12, 1999

I have been asked to investigate the feasibility of converting an Invoice Number field from 6 to 7 digits, and allowing alpha characters. This means CHAR. The Invoice Number is not used outside of the application, but changes would have to be made to the database, and VB code that runs the app. Any ideas on how to proceed?

Any responses would be greatly appreciated!
Thanks

View 1 Replies View Related

Update Char Field...

Jul 12, 2007

ok, so we have a field in one of our db's, a do_not_synch field. this field has a datatype of char...

the following sql statement does not update the field..

update contacts
set do_not_synch = 'Y'
where id=1

and if i open up the table in sql server management studio, and cannot type in and save the value Y...yes i can update other fields in this row...so its not a permissions issue?

is there anything special i should have to do?

Cheers,
Justin

View 1 Replies View Related

DATEADD And Char Field

Apr 25, 2008

Hi,

I have a varchar field that contains values to represent the month and year in the format mmyy (eg. 0107, 0207, 0307 etc).

I want to be able to select the value that is 6 months before the current month and year, for example if I were running the query in the current month/year (April 08) I would return the value 1007 (October 07).

Is someone able to help me with this please?

Thanks

View 8 Replies View Related

Length Of The Value In A Field

Aug 29, 2007

is there a property in the sql server where i can track the length of the value in a field.

Funnyfrog

View 4 Replies View Related

How To Replace Char In Ntext Field

Jun 16, 2006

I need help on replace char in ntext data type

Here is the example data
<qMultipleChoice><qText>The%20AE%20understands%20what%20conditions%20the%2 0Account%20Manager%20is%20allowed%20to%20sign-off
20on.</qText><qChoice>Strongly20Disagree</qChoice><qChoice>Disagree
</qChoice><qChoice>Agree</qChoice><qChoice>Strongly%20Agree</qCh

I want result look like this
First Column:The AE Understands what conditions the Account Manager is allowed to sign-off.
Second Column: Strongly Disagree Disagree Agree Strongly Agree

This is what i had so far
Select (SUBSTRING(QuestionText, (PATINDEX(N'%<qText>%', QuestionText) + 7),(PATINDEX(N'%</qText>%', QuestionText) - (PATINDEX(N'%<qText>%', QuestionText) + 7)))) From tblQuestion

my result:
The%20AE%20understands%20what%20conditions%20the%2 0Account%20Manager%20is%20allowed%20to%20sign-off%20on.

I have problem with replace '%20' and how to make the second column.
Any Help?
Thanks
Shan

View 1 Replies View Related

VARCHAR Max Field Length

Nov 21, 2000

What is the max field length in SQL Server 7.0 that a varchar field can be?
I think 8000. Please advise
Thanks

View 2 Replies View Related

Increasing A Field Length In SQL 6.5

Sep 28, 2001

Hi, can anyone tell me the best/easiest way to increase a field length in a table. We are using SQL 6.5
Regards

View 2 Replies View Related

Where Based On Length Of Field.

Oct 10, 2005

Hey all.

I'm looking around for a solution on how to pull records back based on legnth.

So, if field A is more then 2 characters, return that row.

Thanks
Caden

View 2 Replies View Related

Is It Possible To Get The Max Length Of A TEXT Field?

Dec 1, 2004

I have a text field and want to know if any of the text exceeds 10,000 characters

I can do a select max(len(rtrim(convert(varchar(8000)))) on the field but I'm not able to do for more than 8000 and you can't manipulate TEXT datay type.

Any ideas?
Thanks!

View 1 Replies View Related

Change Length Of Field

Dec 31, 2012

I have a database on sql2000. I want to change the length of a field in Table A, but it is related to another field in Table B. When I tried to change the length of the field in Table A via

ALTER TABLE table ALTER COLUMN field varchar(5).The query analyzer generates the following error.

Server: Msg 5074, Level 16, State 8, Line 1
The object 'UQ__table__77BFCB91' is dependent on column 'field'.
Server: Msg 4922, Level 16, State 1, Line 1

ALTER TABLE ALTER COLUMN field failed because one or more objects access this column.While when I tried the same query on the field in TABLE B, the query completed without any errors.

View 2 Replies View Related

Select Where Length Of Field = 5

Sep 21, 2007

I'm sure it is possible to select all records where the length of a given field equals a certain value, but I don't know how to do it?

Can somebody tell me how?

Hans

View 4 Replies View Related

Finding Non Valid Dates With A Char Field

Aug 9, 2007

I have a table with several million rows of data. There is a date field defined as a char(8) with some bad rows. i tried to locate them with below

select date_stopped from patient_medication
where isdate(convert(datetime,date_stopped)) = 1

This won't work, I get the
Server: Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value

Any way around this?

View 2 Replies View Related

Char(4) Or Integer For Year / Quarter Field

Sep 3, 2007

Hello,

what's best for year resp. quarter Field, char(4) resp. char(1), integer or other?

Both are part of a composite index.

Thanks
Silas

View 6 Replies View Related

JOINing On CHAR Fields Of Different Field Lengths

Nov 30, 2007

Can someone comment on why joining two tables on CHAR fields of different lengths would generate unexpected results?

I had an issue where I ran an update that used an inner join on two tables. The field I used in the join was char(50) in one table and char(13) in another table. The result gave bad matches. After changing the field types both to varchar(30), the problem was eliminate.

Any comments on this would be appreciated.



Rye Guy

View 3 Replies View Related

Search And Replace Only Replaces One Char Per Field

Sep 22, 2006

I am attempting to find quotes (") in a column and replace with the string '--THIS-WAS-QUOTES--'. Right now my script only converts the first quote it finds in the description column, converts to the string and moves to the next row leaving the other quotes as they were. Below is my query script

DECLARE @find varchar(8000),
@replace varchar(8000),
@patfind varchar(8000)

SELECT @find = '"',
@replace = '--THIS-WAS-QUOTES--'

SELECT @patfind = '%' + @find + '%'

UPDATE Incident
SET description = STUFF(convert( varchar(8000), description ),
PATINDEX( @patfind, description ),
DATALENGTH( @find ),
@replace )
WHERE description LIKE @patfind

View 1 Replies View Related

Search And Replace Only Replaces One Char Per Field

Sep 26, 2006

I am attempting to find quotes (") in a column and replace with the string '--THIS-WAS-QUOTES--'. Right now my script only converts the first quote it finds in the description column, converts to the string and moves to the next row leaving the other quotes as they were. Below is my query script

DECLARE @find varchar(8000),
@replace varchar(8000),
@patfind varchar(8000)

SELECT @find = '"',
@replace = '--THIS-WAS-QUOTES--'

SELECT @patfind = '%' + @find + '%'

UPDATE Incident
SET description = STUFF(convert( varchar(8000), description ),
PATINDEX( @patfind, description ),
DATALENGTH( @find ),
@replace )
WHERE description LIKE @patfind

View 4 Replies View Related

What Matter Are There If I Always Set Big Length In Nvarchar Field?

Sep 29, 2006

There are two fieldsA1 nvarchar(30)A2 nvarchar(800)I know nvarchar field is alterable length, if I store a string mystring='abc' to A1 field or to A2 field, I think they use the same disk space, so I think it's always a good way to define a big length nvarchar field such as A3 nvarchar(4000) for any length string, becuase they always use the same disk space, is it right?

View 1 Replies View Related

To Find The Length Of Varbinary Field

May 26, 2000

hai guys,

i want to find out the length of the varbinary field ex: 0x000003752B226B3D0579

thanks
hari

View 1 Replies View Related

Field Length Expansion:URGENT!!

Sep 25, 2000

I need to expand the size of one column which has been defined as varchar(32) to varchar(50).Is this possible?Already there are many old records in the table,in what way it will effect the old records?Any help is appreciated.
Thanks!!

View 2 Replies View Related

Max Length For Varchar And Text Field

Feb 2, 2005

Hi, all
I am seting up a table with email message, I am wondering what is the max length for varchar field. I am so reluctant to use text field, since when
I run query for the descriptiona in sql analyzer, text field cannot be fully display in column. Any tricks to share?
Thanks
Betty

View 5 Replies View Related

Change Field Length W/ Replication

Jun 15, 2001

I have to modify field length in the table, which is part of publication. I tried to use an Enterprise Mgr and received an error message because that table is scheduled for replication.
Is any way around this beside temporary stopping and restarting replication? And actually how to do this to be sure that after restart the data will be again in sync.
We have SQL Server 2000 Enterprise Edition and Windows 2000 Advanced Server.

View 1 Replies View Related

Fixed Length Text Field

Dec 4, 2007

How do I create a text file with fixed length fields from a SQL table using a stored procedure.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved