Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Monday, March 19, 2012

I want to add two text columns

Hi all,
I have a two text columns in my table with more than 100,000 rows.
I want to create a third text column with the data from text column 1 + text
column 2.
Is there an easy way to concatinate two text fields?
Thanks
RajuNo, there is no easy way. Why would you want to do this? Is your SQL
statement too long when you list both columns? This seems like a weird
requirement to me. Usually you use separate TEXT columns because you need
them separate. Otherwise, most applications could have just used a single
text column in the first place.
If you have less than 8000 characters in each column, you could use a view,
and say:
SELECT
..,
ConcatenatedColumn = CONVERT(VARCHAR(8000), textCol1)
+ CONVERT(VARCHAR(8000), textCol2)
FROM
..
Then, you don't have to change the underlying table, or any of the
procedures / apps that insert/update the data. (Or, better yet, if you
don't need TEXT, change the columns to VARCHAR.)
Otherwise, the best way would probably be to add the 3rd column, use an
external app to loop through, concatenate, and update the new column, and
then delete the first two columns. (An external app will be much more
friendly with joining the two values than SQL Server will be internally.)
A
"Raju" <npraju1@.hotmail.com> wrote in message
news:%23mM%237ZCAGHA.2040@.TK2MSFTNGP14.phx.gbl...
> Hi all,
> I have a two text columns in my table with more than 100,000 rows.
> I want to create a third text column with the data from text column 1 +
> text
> column 2.
> Is there an easy way to concatinate two text fields?
> Thanks
> Raju
>|||Aaron,
Thank you for your response.
Actually we have legacy application, which has summary in one text column
and description in one text column.
Our new application has only one column, now my job is to get those two
columns into one new column in our new application.
Hope this helps.
BTW
Unfortunately I can't use your solution as both the columns have huge data,
more than 8000 bytes.
Thanks
Raju
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eWjN6eCAGHA.1256@.TK2MSFTNGP15.phx.gbl...
> No, there is no easy way. Why would you want to do this? Is your SQL
> statement too long when you list both columns? This seems like a weird
> requirement to me. Usually you use separate TEXT columns because you need
> them separate. Otherwise, most applications could have just used a single
> text column in the first place.
> If you have less than 8000 characters in each column, you could use a
view,
> and say:
> SELECT
> ...,
> ConcatenatedColumn = CONVERT(VARCHAR(8000), textCol1)
> + CONVERT(VARCHAR(8000), textCol2)
> FROM
> ...
> Then, you don't have to change the underlying table, or any of the
> procedures / apps that insert/update the data. (Or, better yet, if you
> don't need TEXT, change the columns to VARCHAR.)
> Otherwise, the best way would probably be to add the 3rd column, use an
> external app to loop through, concatenate, and update the new column, and
> then delete the first two columns. (An external app will be much more
> friendly with joining the two values than SQL Server will be internally.)
> A
>
> "Raju" <npraju1@.hotmail.com> wrote in message
> news:%23mM%237ZCAGHA.2040@.TK2MSFTNGP14.phx.gbl...
>

Wednesday, March 7, 2012

I need to display the name of an expanded group

Hi everyone,
I want to display the name of an expanded group within a seperate text
box. The problem is that it doesn't work because my seperate text box
is "not part of the group area" which the name/field belongs to. What
should I do?
How can I access report items of a group outside that group? I though
I could temporarily copy values from a field of a group into a 'global
parameter' (if it's possible, of course) and then make my text box
display the value by referencing that parameter. But since I don't
know how to do that either, I have run out of ideas.On Mar 14, 11:01 am, "mailfo...@.googlemail.com"
<mailfo...@.googlemail.com> wrote:
> Hi everyone,
> I want to display the name of an expanded group within a seperate text
> box. The problem is that it doesn't work because my seperate text box
> is "not part of the group area" which the name/field belongs to. What
> should I do?
> How can I access report items of a group outside that group? I though
> I could temporarily copy values from a field of a group into a 'global
> parameter' (if it's possible, of course) and then make my text box
> display the value by referencing that parameter. But since I don't
> know how to do that either, I have run out of ideas.
If I'm understanding you correctly, you could use something like the
following:
To access a parameter, use an expression like: =Parameters!
ParameterName.Value
To access a dataset outside of it's normal scope, use an expression
like: =Max(Fields!FieldName.Value, "DataSetName")
Hope this helps.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||Its not possible to have a report item placed outside the group. It can be
placed only on header, footer or in the grouping. One option is that in your
grouping you can insert as many blank rows and then place the report items,
but that too static headers not the details of any rows. ie you can refer one
value and not multiple.
Amarnath,MCTS
"mailforpr@.googlemail.com" wrote:
> Hi everyone,
> I want to display the name of an expanded group within a seperate text
> box. The problem is that it doesn't work because my seperate text box
> is "not part of the group area" which the name/field belongs to. What
> should I do?
> How can I access report items of a group outside that group? I though
> I could temporarily copy values from a field of a group into a 'global
> parameter' (if it's possible, of course) and then make my text box
> display the value by referencing that parameter. But since I don't
> know how to do that either, I have run out of ideas.
>|||Thank you very much, guys.
Is there any other way to determine whether a group has been expanded
or not? I don't necessarily have to display a value of a field of a
specific group area in a seperate text box, but rather something like
"oh, you have just expanded group xyz, so I let you know that in that
text box you see over there"...?
The code might probably look like this:
textbox.Value:
=IIF(groupXYZ.Expanded,"Group XYZ is expanded","nothing or something
else is expanded")
Is that possible?

Sunday, February 19, 2012

I need help in Reporting Services 2000 :'(

Hi, i need to know if in RS2000 i can:
1 - Change the text of the exportar link to an image or another text.
2 - Chage de arrangement of the parameters to vertical (one below another)
3 - If there is not results for the query, show a message like "There is not
results for your query, try another filters"
4- Can i add tooltips for the report parameters?
This is really important for me.
Thanks a lot.Regarding (3). I believe there is some sort of RecordCount property to a
dataset. If this is 0, then print your message.
In general, I found the parameter presentation to be a little weak. I still
think they did a good job for version 1
"Carlos López." wrote:
> Hi, i need to know if in RS2000 i can:
> 1 - Change the text of the exportar link to an image or another text.
> 2 - Chage de arrangement of the parameters to vertical (one below another)
> 3 - If there is not results for the query, show a message like "There is not
> results for your query, try another filters"
> 4- Can i add tooltips for the report parameters?
> This is really important for me.
> Thanks a lot.|||Thanks a lot CraigZello, i will try to find the dataset property.
Regards,
"CraigZello" wrote:
> Regarding (3). I believe there is some sort of RecordCount property to a
> dataset. If this is 0, then print your message.
> In general, I found the parameter presentation to be a little weak. I still
> think they did a good job for version 1
> "Carlos López." wrote:
> > Hi, i need to know if in RS2000 i can:
> > 1 - Change the text of the exportar link to an image or another text.
> > 2 - Chage de arrangement of the parameters to vertical (one below another)
> > 3 - If there is not results for the query, show a message like "There is not
> > results for your query, try another filters"
> > 4- Can i add tooltips for the report parameters?
> >
> > This is really important for me.
> >
> > Thanks a lot.|||There is also a NoRows property for item 3.
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:ED581F37-7776-4B47-AC08-86A2E2B540AE@.microsoft.com...
> Hi, i need to know if in RS2000 i can:
> 1 - Change the text of the exportar link to an image or another text.
> 2 - Chage de arrangement of the parameters to vertical (one below another)
> 3 - If there is not results for the query, show a message like "There is
> not
> results for your query, try another filters"
> 4- Can i add tooltips for the report parameters?
> This is really important for me.
> Thanks a lot.|||Thanks MunLeeuw, i will try it.
Regards
"Steve MunLeeuw" wrote:
> There is also a NoRows property for item 3.
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:ED581F37-7776-4B47-AC08-86A2E2B540AE@.microsoft.com...
> > Hi, i need to know if in RS2000 i can:
> > 1 - Change the text of the exportar link to an image or another text.
> > 2 - Chage de arrangement of the parameters to vertical (one below another)
> > 3 - If there is not results for the query, show a message like "There is
> > not
> > results for your query, try another filters"
> > 4- Can i add tooltips for the report parameters?
> >
> > This is really important for me.
> >
> > Thanks a lot.
>
>

I need HEEEEEEELP !

Hi ,
can anyone help me?
I have this Table :
Sourcetable :
ProductID (INT) | LineNo (INT) | Text (Nvarchar)
---
10015 | 10 | This is my
10015 | 12 | best item
10015 | 16 | on Stock.
10020 | 100 | An other
10020 | 110 | item
10020 | 120 | on stock.
I want to copy the rows in a new Table
For Example:
Destinationtable :
ProductID (INT) | Text (nText)
--
10015 | This is my best item on Stock.
10020 | An other item on Stock.
How to do ?Do it through access. Access is a great tool for little things like this. Of
course you can also do it through sql. Try SQL Views.
select everything
For each row in sourcetable
Check for Product ID
If it's the same as the previous row then concatenate the Text field
else
start a new row
Loop
"kepir" <kepir@.discussions.microsoft.com> wrote in message
news:C21CCADB-A127-43ED-8749-09FBCDFB3A23@.microsoft.com...
> Hi ,
> can anyone help me?
> I have this Table :
> Sourcetable :
> ProductID (INT) | LineNo (INT) | Text (Nvarchar)
> ---
> 10015 | 10 | This is my
> 10015 | 12 | best item
> 10015 | 16 | on Stock.
> 10020 | 100 | An other
> 10020 | 110 | item
> 10020 | 120 | on stock.
> I want to copy the rows in a new Table
> For Example:
> Destinationtable :
> ProductID (INT) | Text (nText)
> --
> 10015 | This is my best item on Stock.
> 10020 | An other item on Stock.
> How to do ?|||If you have a small, limited number of rows for each group, you can do:
SELECT ProductId,
MAX( CASE seq WHEN 1 THEN Text ELSE '' END ) +
MAX( CASE seq WHEN 2 THEN ' ' + Text ELSE '' END ) +
MAX( CASE seq WHEN 3 THEN ' ' + Text ELSE '' END ) +
MAX( CASE seq WHEN 4 THEN ' ' + Text ELSE '' END )
FROM ( SELECT ProductId, Text,
( SELECT COUNT( * ) FROM tbl t2
WHERE t2.ProductId = t1.ProductId
AND t2.LineNo <= t1.LineNo )
FROM tbl t1 ) D ( ProductId, Text, seq )
GROUP BY ProductId ;
As far as general approaches in the server, for SQL 2005, try:
http://groups.google.com/group/micr...br />
9b9b968a
For 2000, try:
http://groups.google.com/group/micr...br />
6dd9e73e
Alternatively, for display purposes, you could get the results out of the
server, do the massaging & apply the string manipulation functionalities of
client programming language or report writer as well.
Anith|||I need HEEEEEEELP subject is so immature. Please consider using good subject
and you will get more feedback. gee...
"kepir" <kepir@.discussions.microsoft.com> wrote in message
news:C21CCADB-A127-43ED-8749-09FBCDFB3A23@.microsoft.com...
> Hi ,
> can anyone help me?
> I have this Table :
> Sourcetable :
> ProductID (INT) | LineNo (INT) | Text (Nvarchar)
> ---
> 10015 | 10 | This is my
> 10015 | 12 | best item
> 10015 | 16 | on Stock.
> 10020 | 100 | An other
> 10020 | 110 | item
> 10020 | 120 | on stock.
> I want to copy the rows in a new Table
> For Example:
> Destinationtable :
> ProductID (INT) | Text (nText)
> --
> 10015 | This is my best item on Stock.
> 10020 | An other item on Stock.
> How to do ?|||agreed
"Grant" <email@.nowhere.com> wrote in message
news:OrJWHv9OGHA.3100@.TK2MSFTNGP11.phx.gbl...
> I need HEEEEEEELP subject is so immature. Please consider using good
subject
> and you will get more feedback. gee...
>
>
> "kepir" <kepir@.discussions.microsoft.com> wrote in message
> news:C21CCADB-A127-43ED-8749-09FBCDFB3A23@.microsoft.com...
>|||I'll answer a request for help with 7 E's before one with 5 E's.
In all seriousness, I usually ignore this kind of subject line, because I am
not sure if the poster's problem(s) involve technology in general, never
mind SQL Server specifically.|||I'm not sure we should penalize those with an 'E' key that gets stuck while
the back-space and delete keys are inoperable.
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%23wr7nF%23OGHA.812@.TK2MSFTNGP10.phx.gbl...
> I'll answer a request for help with 7 E's before one with 5 E's.
> In all seriousness, I usually ignore this kind of subject line, because I
> am not sure if the poster's problem(s) involve technology in general,
> never mind SQL Server specifically.
>|||Thank You Anith,
but there is a Syntax Error in Line 9. Is it possible to send me the hole
Code.
For example there is no declaration of "seq".
bye
"Anith Sen" wrote:

> If you have a small, limited number of rows for each group, you can do:
> SELECT ProductId,
> MAX( CASE seq WHEN 1 THEN Text ELSE '' END ) +
> MAX( CASE seq WHEN 2 THEN ' ' + Text ELSE '' END ) +
> MAX( CASE seq WHEN 3 THEN ' ' + Text ELSE '' END ) +
> MAX( CASE seq WHEN 4 THEN ' ' + Text ELSE '' END )
> FROM ( SELECT ProductId, Text,
> ( SELECT COUNT( * ) FROM tbl t2
> WHERE t2.ProductId = t1.ProductId
> AND t2.LineNo <= t1.LineNo )
> FROM tbl t1 ) D ( ProductId, Text, seq )
> GROUP BY ProductId ;
> As far as general approaches in the server, for SQL 2005, try:
> http://groups.google.com/group/micr... />
8a9b9b968a
> For 2000, try:
> http://groups.google.com/group/micr... />
366dd9e73e
> Alternatively, for display purposes, you could get the results out of the
> server, do the massaging & apply the string manipulation functionalities o
f
> client programming language or report writer as well.
> --
> Anith
>
>|||I′m sorry but this is my first posting . I didn′t know that this would be
a
Problem.
I do not know how to change the subject. Next Time i will do it better.
But my Problem is the same. Is there anyone can help me?
bye
"Jeff S" wrote:

> I'm not sure we should penalize those with an 'E' key that gets stuck whil
e
> the back-space and delete keys are inoperable.
>
>
> "Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in messag
e
> news:%23wr7nF%23OGHA.812@.TK2MSFTNGP10.phx.gbl...
>
>|||Without DDLs, I did not bother to create tables & test them.
In any case, lineno & text are reserved words in SQL. It is a bad idea to
use them in usable code. Either change the column names to valid identifiers
or use delimiting characters like double quotes (") or square brackets (
[] ) around the names.
Anith