Is it possible to make a replace query in SQL?
So Find What, Replace With
I have a table with email addresses. But now for more than 500 people it must be changed from user@.company.nl to user@.COMPANY2.nl
Is this possible?
Thanks in advance!Sure: Check out REPLACE in BOL.|||I can't find it. Thanks anyway. But is it also possible with a query?
Can somebody give me and example? ThX!!|||From BOL:
REPLACE
Replaces all occurrences of the second given string expression in the first string expression with a third expression.
Syntax
REPLACE ( 'string_expression1' , 'string_expression2' , 'string_expression3' )
Arguments
'string_expression1'
Is the string expression to be searched. string_expression1 can be of character or binary data.
'string_expression2'
Is the string expression to try to find. string_expression2 can be of character or binary data.
'string_expression3'
Is the replacement string expression string_expression3 can be of character or binary data.
Return Types
Returns character data if string_expression (1, 2, or 3) is one of the supported character data types. Returns binary data if string_expression (1, 2, or 3) is one of the supported binary data types.
Examples
This example replaces the string cde in abcdefghi with xxx.
SELECT REPLACE('abcdefghicde','cde','xxx')
GO
Here is the result set:
----
abxxxfghixxx
(1 row(s) affected)|||ThX mate. I will try to make a good one now.|||I got it, ThX!
For example:
SELECT REPLACE(email_address, 'Pedro.nl', 'Pedro.com') from crm5.email|||Hmmm, I was to early. It doens't change anything in the colum.|||Now i got it.
This is the query i want:
Update crm5.email
SET email_address =REPLACE(email_address, 'Company.nl', 'Pedro.com')
from crm5.email|||You will have to write a update query
some thing like
update crm5.email
set email_address = REPLACE(email_address, 'Pedro.nl', 'Pedro.com')
Showing posts with label addresses. Show all posts
Showing posts with label addresses. Show all posts
Friday, March 23, 2012
Friday, March 9, 2012
repeat group header at top of new page
I have a report of addresses, grouped by Street Name.
Output type is PDF.
When the report breaks onto a new page, I would like the Group Header - the Street Name last listed on the previous page - to repeat at the top.
Currently it seems to only repeat when the Street Name changes.
Is that possible? If so, how?The grouping and sorting properties dialog has an option to repeat the group
header. Setting this option should do the trick for you. Assuming you are
using a table you can reach this feature by opening the table properties
dialog. Next you would click on the Groups tab. Finally you will need to
edit the Streets Name group.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Greg Anderson" <GregAnderson@.discussions.microsoft.com> wrote in message
news:EA1A1F82-AA0D-4445-AC4E-C88C9EDB0444@.microsoft.com...
> I have a report of addresses, grouped by Street Name.
> Output type is PDF.
> When the report breaks onto a new page, I would like the Group Header -
the Street Name last listed on the previous page - to repeat at the top.
> Currently it seems to only repeat when the Street Name changes.
> Is that possible? If so, how?|||Let me also say that I have gone into the Table Properties and set the "Repeat header rows on each page"
This works when I send it a parameter to sort one way - by street name - but not when I send the sort parameter of "sequence" which is another column in my report.
Any ideas?
"Greg Anderson" wrote:
> I have a report of addresses, grouped by Street Name.
> Output type is PDF.
> When the report breaks onto a new page, I would like the Group Header - the Street Name last listed on the previous page - to repeat at the top.
> Currently it seems to only repeat when the Street Name changes.
> Is that possible? If so, how?
Output type is PDF.
When the report breaks onto a new page, I would like the Group Header - the Street Name last listed on the previous page - to repeat at the top.
Currently it seems to only repeat when the Street Name changes.
Is that possible? If so, how?The grouping and sorting properties dialog has an option to repeat the group
header. Setting this option should do the trick for you. Assuming you are
using a table you can reach this feature by opening the table properties
dialog. Next you would click on the Groups tab. Finally you will need to
edit the Streets Name group.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Greg Anderson" <GregAnderson@.discussions.microsoft.com> wrote in message
news:EA1A1F82-AA0D-4445-AC4E-C88C9EDB0444@.microsoft.com...
> I have a report of addresses, grouped by Street Name.
> Output type is PDF.
> When the report breaks onto a new page, I would like the Group Header -
the Street Name last listed on the previous page - to repeat at the top.
> Currently it seems to only repeat when the Street Name changes.
> Is that possible? If so, how?|||Let me also say that I have gone into the Table Properties and set the "Repeat header rows on each page"
This works when I send it a parameter to sort one way - by street name - but not when I send the sort parameter of "sequence" which is another column in my report.
Any ideas?
"Greg Anderson" wrote:
> I have a report of addresses, grouped by Street Name.
> Output type is PDF.
> When the report breaks onto a new page, I would like the Group Header - the Street Name last listed on the previous page - to repeat at the top.
> Currently it seems to only repeat when the Street Name changes.
> Is that possible? If so, how?
Subscribe to:
Posts (Atom)