Showing posts with label datatype. Show all posts
Showing posts with label datatype. Show all posts

Friday, March 9, 2012

Insert-Retrive-Update in Text datatype.

Can anyone guide how to retrieve, update and insert data in column having 'Text' datatype? I am a newbie and i havent' done this yet.

Thanks in advance.

If you are using SQL Server 2005 consider using a VARCHAR(MAX) or NVARCHAR(MAX) instead of a text datatype. Look up the VARCHAR(MAX) and TEXT datatypes in books online.|||

No. i am using sql 2000 and i wanted to know the method of retriving and updating data usign text datatypes.

thanksk,

|||Use it in the same manner that you would use a normal varchar column. The only difference is that when using it in a where condition you can't use the '=' operator. You have to use 'like'. Other than that inserting, updating and retrieving is exactly the same.

Best regards,
Sami Samir|||

Please see the links below for some samples. For text/ntext/image value manipulation, you can use UPDATETEXT/WRITETEXT/READTEXT or SELECT/INSERT/UPDATE statements depending on your needs. There are functions like DATALENGTH and PATINDEX that will work with these data types too.

http://www.umachandar.com/technical/SQL6x70Scripts/Main53.htm

http://www.umachandar.com/technical/SQL6x70Scripts/Main63.htm

http://www.umachandar.com/technical/SQL6x70Scripts/Main12.htm

Wednesday, March 7, 2012

Inserting values

Dear All,

In sql-server2000
In a table i am having a column of datatype varchar(8000).
While inserting the record through executenonquery, i am insert only
255 characters rest of the characters are getting trucated.

My question in how i will able to insert the row of that particular
column more than 255 characters

Thanx in advance.

Regardsfix the query.

i dunno what the query is or the command parameter info, so you'll just have to read on how to change the length of that sqldbtype.|||Dear Kragie,

thanx for your reply.

i am using command parameter info is command text and and directly using "Insert command".

Regards

Friday, February 24, 2012

Inserting symbols in field

Hi All,
I am trying to insert symbols in a field of a table.

I am using the datatype nvarchar for the field.
However when i tried to insert a statement with the symbol pi, it comes out as following:
(A) 100? cm2 (B) 140? cm2 (C) 200? cm2

All the pi symbol are converted to ?.

Can ne 1 tell me how i can store such strings in the field.

Thanks

Both the client tool that inserts the symbol AND the client tool that displays the symbol MUST be capable of displaying the symbols. And the symbol for p is not included in the ascii set used by SSMS.

You can store unicode, and you can display unicode -you just can't do it with the SQL Server client tools.

How are you displaying the fields (what application?)

inserting symbols in field

Hi All,
I am trying to insert symbols in a field of a table.

I am using the datatype nvarchar for the field.
However when i tried to insert a statement with the symbol pi, it comes out as following:
(A) 100? cm2 (B) 140? cm2 (C) 200? cm2

All the pi symbol are converted to ?.

Can ne 1 tell me how i can store such strings in the field.

Thanks

You're not stating how you're inserting the strings. If you're inserting using a plain INSERT statement you must N-prefix the string literals when using nvarchar.

INSERT INTO thetable (thecolumn,anothercolumn) VALUES(N'whatever',N'however')