Showing posts with label building. Show all posts
Showing posts with label building. Show all posts

Monday, March 19, 2012

Line Break in T-SQL

Hello,

In a Stored Proc, I am building a string variable. I am getting outputs
from 4 different queries and would like the string to have line breaks
to display each entry in a different line in a text area. How can I do
this?

i.e
result = result1 + result2 + result3 + result4.
What characters can I enter so that the output is displayed in the
textarea as
result1
result2
result3
result4

Thanks,SELECT 'asdfasd'+char(13)+'ASDF ASF ASDF ASD'

maybe it's CHR not CHAR|||The line terminator on a Windows platform is carriage return/line feed
(ASCII 10 and 13). You can concatenate CHAR(13) + CHAR(10) where you want
line breaks.

--
Hope this helps.

Dan Guzman
SQL Server MVP

<nashak@.hotmail.comwrote in message
news:1158285904.128023.10670@.e3g2000cwe.googlegrou ps.com...

Quote:

Originally Posted by

Hello,
>
In a Stored Proc, I am building a string variable. I am getting outputs
from 4 different queries and would like the string to have line breaks
to display each entry in a different line in a text area. How can I do
this?
>
i.e
result = result1 + result2 + result3 + result4.
What characters can I enter so that the output is displayed in the
textarea as
result1
result2
result3
result4
>
Thanks,
>

|||On 14 Sep 2006 19:05:04 -0700, nashak@.hotmail.com wrote:

Quote:

Originally Posted by

>Hello,
>
>In a Stored Proc, I am building a string variable. I am getting outputs
>from 4 different queries and would like the string to have line breaks
>to display each entry in a different line in a text area. How can I do
>this?


Hi Nashak,

In addition to the answers already given by Alexander and Dan, here's
another option - just use a newline character inside a string constant.

For example:

SELECT 'First line
Second line.'

This will show the output on two lines (make sure to select output to
text, not output to grid - the grid doesn't handle newlines too well).

If the data comes from columns, try

SELECT Column1 + '
' + Column2
FROM YourTable
WHERE ...

--
Hugo Kornelis, SQL Server MVP

Monday, March 12, 2012

Limiting Records Returned

I'm building an Access front end (A2K2 ADP project) to view records on a SQL 2000 Server, and want to ensure the fastest performance for my users. I expect the database to grow to around 25,000 records (after that, they'll be archived), and would like opi
nions/comments on the best way to access the data. I would guess that a recordset would be fastest, but how do you set up a form to be based on a recordset instead of just hooking directly to the underlying table?
TIA,
Terry Roberts
Check the ADO and ADP references in the Microsoft Office
2000/Visual Basic Programmer's Guide:
http://msdn.microsoft.com/library/de...radobasics.asp
You can also find a list of Access resources here:
http://msdn.microsoft.com/library/en...acacclinks.asp
And...you really should considering getting the book: Access
Developer's Guide to SQL Server by
Mary Chipman and Andy Baron.
-Sue
On Mon, 10 May 2004 09:11:08 -0700, "Terry Roberts"
<anonymous@.discussions.microsoft.com> wrote:

>I'm building an Access front end (A2K2 ADP project) to view records on a SQL 2000 Server, and want to ensure the fastest performance for my users. I expect the database to grow to around 25,000 records (after that, they'll be archived), and would like op
inions/comments on the best way to access the data. I would guess that a recordset would be fastest, but how do you set up a form to be based on a recordset instead of just hooking directly to the underlying table?
>TIA,
>Terry Roberts

Friday, March 9, 2012

Limiting Records Returned

I'm building an Access front end (A2K2 ADP project) to view records on a SQL
2000 Server, and want to ensure the fastest performance for my users. I exp
ect the database to grow to around 25,000 records (after that, they'll be ar
chived), and would like opi
nions/comments on the best way to access the data. I would guess that a reco
rdset would be fastest, but how do you set up a form to be based on a record
set instead of just hooking directly to the underlying table?
TIA,
Terry RobertsCheck the ADO and ADP references in the Microsoft Office
2000/Visual Basic Programmer's Guide:
adobasics.asp" target="_blank">http://msdn.microsoft.com/library/d...
adobasics.asp
You can also find a list of Access resources here:
http://msdn.microsoft.com/library/e.../acacclinks.asp
And...you really should considering getting the book: Access
Developer's Guide to SQL Server by
Mary Chipman and Andy Baron.
-Sue
On Mon, 10 May 2004 09:11:08 -0700, "Terry Roberts"
<anonymous@.discussions.microsoft.com> wrote:

>I'm building an Access front end (A2K2 ADP project) to view records on a SQL 2000 S
erver, and want to ensure the fastest performance for my users. I expect the databas
e to grow to around 25,000 records (after that, they'll be archived), and would like
op
inions/comments on the best way to access the data. I would guess that a recordset would be
fastest, but how do you set up a form to be based on a recordset instead of just hooking dir
ectly to the underlying table?
>TIA,
>Terry Roberts

Limiting Records Returned

I'm building an Access front end (A2K2 ADP project) to view records on a SQL 2000 Server, and want to ensure the fastest performance for my users. I expect the database to grow to around 25,000 records (after that, they'll be archived), and would like opinions/comments on the best way to access the data. I would guess that a recordset would be fastest, but how do you set up a form to be based on a recordset instead of just hooking directly to the underlying table
TIA
Terry RobertsCheck the ADO and ADP references in the Microsoft Office
2000/Visual Basic Programmer's Guide:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovradobasics.asp
You can also find a list of Access resources here:
http://msdn.microsoft.com/library/en-us/dnacc2k/html/acacclinks.asp
And...you really should considering getting the book: Access
Developer's Guide to SQL Server by
Mary Chipman and Andy Baron.
-Sue
On Mon, 10 May 2004 09:11:08 -0700, "Terry Roberts"
<anonymous@.discussions.microsoft.com> wrote:
>I'm building an Access front end (A2K2 ADP project) to view records on a SQL 2000 Server, and want to ensure the fastest performance for my users. I expect the database to grow to around 25,000 records (after that, they'll be archived), and would like opinions/comments on the best way to access the data. I would guess that a recordset would be fastest, but how do you set up a form to be based on a recordset instead of just hooking directly to the underlying table?
>TIA,
>Terry Roberts