I am using a data type of varchar with a size of 5000. Why can I only
fit 1023 characters in the field?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Dinesh,
I am viewing the data through Enterprise Manager. I am
cutting and pasting data from a word document into the
varchar field that I set to 5000. Only 1023 characters
will fit. Why is that?
How can I use Query Analyzer to add data? I didn't know
you could do that other than using stored procedures or
insert queries.
>--Original Message--
>John,
>We need more details.How are you 'viewing' the data?If
through Query
>analyzer, make sure to increase the number in Tools menu
| options and
>'results' tab.You can always check the length of the
record in the table by
>using :
>SELECT length = DATALENGTH(<columnname>)
>FROM dbo.<tablename>
>Also, note that if you are inserting the data via
enterprise manager, it
>has this restriction.Always use Query Analyzer for
editing purposes.
>--
>Dinesh.
>SQL Server FAQ at
>http://www.tkdinesh.com
>"John Peters" <web_2@.yahoo.com> wrote in message
>news:%23wyDaYDXDHA.888@.TK2MSFTNGP10.phx.gbl...
>> I am using a data type of varchar with a size of
5000. Why can I only
>> fit 1023 characters in the field?
>> *** Sent via Developersdex
http://www.developersdex.com ***
>> Don't just participate in USENET...get rewarded for it!
>
>.
>|||John,
>>Why is that?
Thats a limitation with enterprise manager.
>>How can I use Query Analyzer to add data?
I meant use Query Analyzer(QA) to execute the INSERT (INTO) command to
insert data to a table.For example, execute the below script in QA:
SET NOCOUNT ON
--Checking if the table already exists.If so, drop it.
IF OBJECT_ID('dtatruntest','u') IS NOT NULL
DROP TABLE dtatruntest
GO
--Creating the table.
CREATE TABLE dtatruntest
(
dte VARCHAR(5000)
)
GO
--Inserting a row of length 5000
INSERT dbo.dtatruntest VALUES(REPLICATE('a',5000))
GO
--Checking if the entire row got inserted.
SELECT length = DATALENGTH(dte)FROM dbo.dtatruntest
GO
--selecting the row after making sure that the results number is
--increased in QA.
SELECT * FROM dbo.dtatruntest
GO
SET NOCOUNT OFF
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"John Peters" <web@.email.com> wrote in message
news:005101c35d01$c9814ab0$a401280a@.phx.gbl...
> Dinesh,
> I am viewing the data through Enterprise Manager. I am
> cutting and pasting data from a word document into the
> varchar field that I set to 5000. Only 1023 characters
> will fit. Why is that?
> How can I use Query Analyzer to add data? I didn't know
> you could do that other than using stored procedures or
> insert queries.
> >--Original Message--
> >John,
> >
> >We need more details.How are you 'viewing' the data?If
> through Query
> >analyzer, make sure to increase the number in Tools menu
> | options and
> >'results' tab.You can always check the length of the
> record in the table by
> >using :
> >
> >SELECT length = DATALENGTH(<columnname>)
> >FROM dbo.<tablename>
> >
> >Also, note that if you are inserting the data via
> enterprise manager, it
> >has this restriction.Always use Query Analyzer for
> editing purposes.
> >
> >--
> >Dinesh.
> >SQL Server FAQ at
> >http://www.tkdinesh.com
> >
> >"John Peters" <web_2@.yahoo.com> wrote in message
> >news:%23wyDaYDXDHA.888@.TK2MSFTNGP10.phx.gbl...
> >> I am using a data type of varchar with a size of
> 5000. Why can I only
> >> fit 1023 characters in the field?
> >>
> >> *** Sent via Developersdex
> http://www.developersdex.com ***
> >> Don't just participate in USENET...get rewarded for it!
> >
> >
> >.
> >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment