Showing posts with label characters. Show all posts
Showing posts with label characters. Show all posts

Monday, March 19, 2012

Line feed problem in HTML

I'm using a string in report which contains chr(10) -> Line feed characters. They show up correctly (there are several lines) in Preview screen and in pdf-format but NOT in browser. I think the browser doesn't understand those characters. Is there a way to replace them somehow with other useful keys? If there is an example would be great...

I use the equivalent of the old vbCrLf i.e. carriage return followed by a line feed, and this works fine in the HTML.

Try using Chr(13) & Chr(10) or the .NET property Environment.NewLine.

For formatting in SQL I use CHAR(13) + CHAR(10)

|||I'm sorry but I didn't get it. I have 3 rows long field in report(Fields!Address.value) and that value contains those carriage returns. So should I edit the expression of the field to find where the carriage returns are and replace them somehow?|||try Replace(Fields!Address.Value, chr(10), Environment.NewLine)

Friday, February 24, 2012

Limitation of 1023 Characters

I am using ASP to query a SQL Server 2000 database.
Whenever I try to insert large pieces of data (column is
declared as varchar), the data allowed is limited to 1023
characters. I have installed SP3, and still the same
error. It is not down to any syntax in the cell as trying
to insert 1024 instances of "b" (bbbbb etc. etc.) will
error on the insertion of the 1024th. I am sure this must
be a configuration conflict somewhere.
Anybody out there able to help me rectify this?
Many thanks
Martin Burford> Whenever I try to insert large pieces of data (column is
> declared as varchar),
VARCHAR(what?)
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Sorry. Varchar(4000) in this case.
Martin
>--Original Message--
>> Whenever I try to insert large pieces of data (column
is
>> declared as varchar),
>VARCHAR(what?)
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>.
>|||All right, so can you show the statement that ASP is trying to run (e.g. if
you are using conn.execute sqlStatement, use response.write sqlStatement
instead, and show us the result).
Also, the exact error message might be helpful.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
<anonymous@.discussions.microsoft.com> wrote in message
news:1401c01c3c306$dce2d860$a601280a@.phx.gbl...
> Sorry. Varchar(4000) in this case.
> Martin
> >--Original Message--
> >> Whenever I try to insert large pieces of data (column
> is
> >> declared as varchar),
> >
> >VARCHAR(what?)
> >
> >--
> >Aaron Bertrand
> >SQL Server MVP
> >http://www.aspfaq.com/
> >
> >
> >.
> >|||I think I have actually determined the error. I was
entering my data through Enterprise Manager, which I'm
guessing can't accept more than a byte of info (1,024
chars a bit of a coincedence). Entering the data through
INSERT statements in Query Analyzer works upto 4000 chars
which is fine. This however causes a slight problem...is
there an easier way rather than creating custom insert
statements for each record? Otherwise, I'll just create a
basic admin area interface, and insert the code through
submitted form values (textareas).
Many thanks
Martin Burford
>--Original Message--
>All right, so can you show the statement that ASP is
trying to run (e.g. if
>you are using conn.execute sqlStatement, use
response.write sqlStatement
>instead, and show us the result).
>Also, the exact error message might be helpful.
>--
>Aaron Bertrand
>SQL Server MVP
>http://www.aspfaq.com/
>
>
><anonymous@.discussions.microsoft.com> wrote in message
>news:1401c01c3c306$dce2d860$a601280a@.phx.gbl...
>> Sorry. Varchar(4000) in this case.
>> Martin
>> >--Original Message--
>> >> Whenever I try to insert large pieces of data
(column
>> is
>> >> declared as varchar),
>> >
>> >VARCHAR(what?)
>> >
>> >--
>> >Aaron Bertrand
>> >SQL Server MVP
>> >http://www.aspfaq.com/
>> >
>> >
>> >.
>> >
>
>.
>|||> I think I have actually determined the error. I was
> entering my data through Enterprise Manager,
Don't do that! Enterprise Manager should be used for management, not data
entry.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||http://www.aspfaq.com/search.asp?q=enterprise+manager+1023+characters
:-)
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Martin Burford" <martin_burford@.hotmail.com> wrote in message
news:065101c3c314$97ee3980$a401280a@.phx.gbl...
> I think I have actually determined the error. I was
> entering my data through Enterprise Manager, which I'm
> guessing can't accept more than a byte of info (1,024
> chars a bit of a coincedence). Entering the data through
> INSERT statements in Query Analyzer works upto 4000 chars
> which is fine. This however causes a slight problem...is
> there an easier way rather than creating custom insert
> statements for each record? Otherwise, I'll just create a
> basic admin area interface, and insert the code through
> submitted form values (textareas).
> Many thanks
> Martin Burford
> >--Original Message--
> >All right, so can you show the statement that ASP is
> trying to run (e.g. if
> >you are using conn.execute sqlStatement, use
> response.write sqlStatement
> >instead, and show us the result).
> >
> >Also, the exact error message might be helpful.
> >
> >--
> >Aaron Bertrand
> >SQL Server MVP
> >http://www.aspfaq.com/
> >
> >
> >
> >
> ><anonymous@.discussions.microsoft.com> wrote in message
> >news:1401c01c3c306$dce2d860$a601280a@.phx.gbl...
> >> Sorry. Varchar(4000) in this case.
> >>
> >> Martin
> >>
> >> >--Original Message--
> >> >> Whenever I try to insert large pieces of data
> (column
> >> is
> >> >> declared as varchar),
> >> >
> >> >VARCHAR(what?)
> >> >
> >> >--
> >> >Aaron Bertrand
> >> >SQL Server MVP
> >> >http://www.aspfaq.com/
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >

Monday, February 20, 2012

Limit string lengh

There is a way to limit the length in characters returned by but I cant find what it is.

As an example, returning only the first 20 characters of a field.

Any help would be greatly appreciated.

You can either SUBSTRING or LEFT string functions in your case to get what you want. For example,

SELECTLEFT(yourcolumn, 20)AS col20_1,SUBSTRING(yourcolumn,1,20)as co20_2 FROM yourtable

You can find more string function from this link.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_fa-fz_7oqb.asp

Limno

|||Thank you!

Limit on row size for reading fixed-width .txt?

Hi,
I have a customer who wants to send a fixed width file with 1400 characters per row.
Before I tell the 'OK', I was wondering if there is any limit to the length of rows when using a DTS .txt source.
Anyone know?
Thanks!You have a sql row limit of 8060

Why not bcp the data in?

Does the process have to be repeated?|||My "personal best" was a smidgeon over 20 Kb per row of text. 2000 ten digit integers with a space between them per row.

-PatP|||OK, so 1400 characters is pretty puny.

This will be a weekly feed that begins with an FTP'd file and ends only after updating all of that company's organization structure, employees, employee contacts, etc. and then emailing a summary of the results and any errors to our DBA. Currently we run a bunch of these as DTS as it is easy to have some tasks be custom to the specific customer and others be based on stock scripts.

We're not looking forward to moving to Yukon. I hear that you can't upgrade DTS.

Thanks for the info guys!|||That's not true about upgrading DTS. The problem is HOW you have to upgrade. You basically take the whole VBScript it produces and plop it in there to run. It will run, but you lose all the graphical interface. I'm hoping they've changed that. I haven't really spent time looking at IS since the early notes on it. Too busy looking at all the other kewl features.|||Sounds like this will not go off without some triage and repair, particularly in our more sophisticated, looping DTS where we enable and disable tasks based on the data.|||If you mean data driven tasks, oh boy will you be excited.

There are some features that just plain won't be portable (the VBA/Active X and UDL in particular), others will require significant "triage", but most features ought to be relatively portable. I won't take any bets until I see RC, because there are so many things that aren't "final" yet.

-PatP|||I agree that we won't know until we've started to move our own stuff over.

But I'm betting it will be seriously annoying!