Wednesday, March 28, 2012
Replacing a Server
I just replaced a Windows 2003 server. The old server had SLQ Server 2000 on
it. Is there an artcile I can read on how to transfer everything over from
one server to the other.
Thanks,
Kevin.
Basically, you can do a backup and restore of most of the databases. You
can create DTS packages to migrate jobs and logins.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"Kevin" <Kevin@.discussions.microsoft.com> wrote in message
news:AE75FF39-4E1C-4DE2-B92A-082BBCB57D42@.microsoft.com...
Hi,
I just replaced a Windows 2003 server. The old server had SLQ Server 2000 on
it. Is there an artcile I can read on how to transfer everything over from
one server to the other.
Thanks,
Kevin.
|||Hi,
Look into the KB article:-
http://support.microsoft.com/default...b;EN-US;224071
Since this help you to move system databases as well; there is no need to
copy Logins; users;jobs; dts packages from old server.
Thanks
Hari
SQL Server MVP
"Kevin" <Kevin@.discussions.microsoft.com> wrote in message
news:AE75FF39-4E1C-4DE2-B92A-082BBCB57D42@.microsoft.com...
> Hi,
> I just replaced a Windows 2003 server. The old server had SLQ Server 2000
> on
> it. Is there an artcile I can read on how to transfer everything over from
> one server to the other.
> Thanks,
> Kevin.
Replacing a Server
I just replaced a Windows 2003 server. The old server had SLQ Server 2000 on
it. Is there an artcile I can read on how to transfer everything over from
one server to the other.
Thanks,
Kevin.Basically, you can do a backup and restore of most of the databases. You
can create DTS packages to migrate jobs and logins.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Kevin" <Kevin@.discussions.microsoft.com> wrote in message
news:AE75FF39-4E1C-4DE2-B92A-082BBCB57D42@.microsoft.com...
Hi,
I just replaced a Windows 2003 server. The old server had SLQ Server 2000 on
it. Is there an artcile I can read on how to transfer everything over from
one server to the other.
Thanks,
Kevin.|||Hi,
Look into the KB article:-
http://support.microsoft.com/defaul...kb;EN-US;224071
Since this help you to move system databases as well; there is no need to
copy Logins; users;jobs; dts packages from old server.
Thanks
Hari
SQL Server MVP
"Kevin" <Kevin@.discussions.microsoft.com> wrote in message
news:AE75FF39-4E1C-4DE2-B92A-082BBCB57D42@.microsoft.com...
> Hi,
> I just replaced a Windows 2003 server. The old server had SLQ Server 2000
> on
> it. Is there an artcile I can read on how to transfer everything over from
> one server to the other.
> Thanks,
> Kevin.
Replacing a Server
I just replaced a Windows 2003 server. The old server had SLQ Server 2000 on
it. Is there an artcile I can read on how to transfer everything over from
one server to the other.
Thanks,
Kevin.Basically, you can do a backup and restore of most of the databases. You
can create DTS packages to migrate jobs and logins.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Kevin" <Kevin@.discussions.microsoft.com> wrote in message
news:AE75FF39-4E1C-4DE2-B92A-082BBCB57D42@.microsoft.com...
Hi,
I just replaced a Windows 2003 server. The old server had SLQ Server 2000 on
it. Is there an artcile I can read on how to transfer everything over from
one server to the other.
Thanks,
Kevin.|||Hi,
Look into the KB article:-
http://support.microsoft.com/default.aspx?scid=kb;EN-US;224071
Since this help you to move system databases as well; there is no need to
copy Logins; users;jobs; dts packages from old server.
Thanks
Hari
SQL Server MVP
"Kevin" <Kevin@.discussions.microsoft.com> wrote in message
news:AE75FF39-4E1C-4DE2-B92A-082BBCB57D42@.microsoft.com...
> Hi,
> I just replaced a Windows 2003 server. The old server had SLQ Server 2000
> on
> it. Is there an artcile I can read on how to transfer everything over from
> one server to the other.
> Thanks,
> Kevin.
Monday, March 26, 2012
REPLACE with NULL
When I use the following:
REPLACE(CategoryType_ID, 'Non Selected', null)
all the values are replaced with NULL even when the value is not "'Non
Selected".
Any help with understanding why this happens would be appreciated.
Thanks, sck10The REPLACE function returns NULL if any one of the arguments is NULL. The
right function to do what you need is NULLIF:
NULLIF(CategoryType_ID, 'Non Selected')
You can also accomplish the same with CASE:
CASE WHEN CategoryType_ID = 'Non Selected'
THEN NULL
ELSE CategoryType_ID
END
I am assuming here the CategoryType_ID column is a character data type.
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||Hi
"sck10" wrote:
> Hello,
> When I use the following:
> REPLACE(CategoryType_ID, 'Non Selected', null)
> all the values are replaced with NULL even when the value is not "'Non
> Selected".
> Any help with understanding why this happens would be appreciated.
> Thanks, sck10
If this is an update you can
UPDATE mYtable
SET CategoryType_ID = NULL
WHERE CategoryType_ID = 'Non Selected'
John|||Thanks Plamen Ratchev,
just what I was looking for...
sck10
"Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
news:uWahjljfHHA.4980@.TK2MSFTNGP02.phx.gbl...
> The REPLACE function returns NULL if any one of the arguments is NULL. The
> right function to do what you need is NULLIF:
> NULLIF(CategoryType_ID, 'Non Selected')
> You can also accomplish the same with CASE:
> CASE WHEN CategoryType_ID = 'Non Selected'
> THEN NULL
> ELSE CategoryType_ID
> END
> I am assuming here the CategoryType_ID column is a character data type.
> HTH,
> Plamen Ratchev
> http://www.SQLStudio.com
>|||Thanks John,
sck10
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:EAA2A779-0D99-4F93-A464-F855323CB61A@.microsoft.com...
> Hi
> "sck10" wrote:
>> Hello,
>> When I use the following:
>> REPLACE(CategoryType_ID, 'Non Selected', null)
>> all the values are replaced with NULL even when the value is not "'Non
>> Selected".
>> Any help with understanding why this happens would be appreciated.
>> Thanks, sck10
> If this is an update you can
> UPDATE mYtable
> SET CategoryType_ID = NULL
> WHERE CategoryType_ID = 'Non Selected'
> John
>sql
REPLACE with NULL
When I use the following:
REPLACE(CategoryType_ID, 'Non Selected', null)
all the values are replaced with NULL even when the value is not "'Non
Selected".
Any help with understanding why this happens would be appreciated.
Thanks, sck10
The REPLACE function returns NULL if any one of the arguments is NULL. The
right function to do what you need is NULLIF:
NULLIF(CategoryType_ID, 'Non Selected')
You can also accomplish the same with CASE:
CASE WHEN CategoryType_ID = 'Non Selected'
THEN NULL
ELSE CategoryType_ID
END
I am assuming here the CategoryType_ID column is a character data type.
HTH,
Plamen Ratchev
http://www.SQLStudio.com
|||Hi
"sck10" wrote:
> Hello,
> When I use the following:
> REPLACE(CategoryType_ID, 'Non Selected', null)
> all the values are replaced with NULL even when the value is not "'Non
> Selected".
> Any help with understanding why this happens would be appreciated.
> Thanks, sck10
If this is an update you can
UPDATE mYtable
SET CategoryType_ID = NULL
WHERE CategoryType_ID = 'Non Selected'
John
|||Thanks Plamen Ratchev,
just what I was looking for...
sck10
"Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
news:uWahjljfHHA.4980@.TK2MSFTNGP02.phx.gbl...
> The REPLACE function returns NULL if any one of the arguments is NULL. The
> right function to do what you need is NULLIF:
> NULLIF(CategoryType_ID, 'Non Selected')
> You can also accomplish the same with CASE:
> CASE WHEN CategoryType_ID = 'Non Selected'
> THEN NULL
> ELSE CategoryType_ID
> END
> I am assuming here the CategoryType_ID column is a character data type.
> HTH,
> Plamen Ratchev
> http://www.SQLStudio.com
>
|||Thanks John,
sck10
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:EAA2A779-0D99-4F93-A464-F855323CB61A@.microsoft.com...
> Hi
> "sck10" wrote:
>
> If this is an update you can
> UPDATE mYtable
> SET CategoryType_ID = NULL
> WHERE CategoryType_ID = 'Non Selected'
> John
>
REPLACE with NULL
When I use the following:
REPLACE(CategoryType_ID, 'Non Selected', null)
all the values are replaced with NULL even when the value is not "'Non
Selected".
Any help with understanding why this happens would be appreciated.
Thanks, sck10The REPLACE function returns NULL if any one of the arguments is NULL. The
right function to do what you need is NULLIF:
NULLIF(CategoryType_ID, 'Non Selected')
You can also accomplish the same with CASE:
CASE WHEN CategoryType_ID = 'Non Selected'
THEN NULL
ELSE CategoryType_ID
END
I am assuming here the CategoryType_ID column is a character data type.
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||Hi
"sck10" wrote:
> Hello,
> When I use the following:
> REPLACE(CategoryType_ID, 'Non Selected', null)
> all the values are replaced with NULL even when the value is not "'Non
> Selected".
> Any help with understanding why this happens would be appreciated.
> Thanks, sck10
If this is an update you can
UPDATE mYtable
SET CategoryType_ID = NULL
WHERE CategoryType_ID = 'Non Selected'
John|||Thanks Plamen Ratchev,
just what I was looking for...
sck10
"Plamen Ratchev" <Plamen@.SQLStudio.com> wrote in message
news:uWahjljfHHA.4980@.TK2MSFTNGP02.phx.gbl...
> The REPLACE function returns NULL if any one of the arguments is NULL. The
> right function to do what you need is NULLIF:
> NULLIF(CategoryType_ID, 'Non Selected')
> You can also accomplish the same with CASE:
> CASE WHEN CategoryType_ID = 'Non Selected'
> THEN NULL
> ELSE CategoryType_ID
> END
> I am assuming here the CategoryType_ID column is a character data type.
> HTH,
> Plamen Ratchev
> http://www.SQLStudio.com
>|||Thanks John,
sck10
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:EAA2A779-0D99-4F93-A464-F855323CB61A@.microsoft.com...
> Hi
> "sck10" wrote:
>
> If this is an update you can
> UPDATE mYtable
> SET CategoryType_ID = NULL
> WHERE CategoryType_ID = 'Non Selected'
> John
>
Replace syntax error
Hello
In my database table I have replaced <h3> Some Text </h3> with <h2> Some Text </h2> in the Description column as below:
UPDATE CAT_Products
SET Description = replace (Description, '</h3>', '</h2>')
WHERE Description <> '</h2>'
UPDATE CAT_Products
SET Description = replace (Description, '<h3>', '<h2>')
WHERE Description <> '<h2>'
However, when I try the same replace syntax code with the DescriptionHTML column in the same table, it does not work, e.g.
UPDATE CAT_Products
SET DescriptionHTML = replace (DescriptionHTML, ' <h3> ', '<h2>')
WHERE Description <> '<h2>'
What do I need to adjust?
Thanks
can you explain what you mean by not working? also pls provide some sample data you have that you are expecting the REPLACE to happen on.
|||Hello ndinaker
When I put in this code:
UPDATE CAT_Products
SET DescriptionHTML = replace (DescriptionHTML, ' <h3> ', '<h2>')
WHERE Description <> '<h2>'
I dose not execute and I get this error message instead:
[Error] Script lines: 1-5 --------
Argument data type ntext is invalid for argument 1 of replace function.
[Executed: 12/04/07 19:17:21 BST ] [Execution: 0/ms]
As in the text Description column, I am trying to update the <h3> and </h3> to <h2> and </h2> for example: <h3> Some Text </h3> to be replaced by <h2> Some Text </h2>
However, as it is written in html format in the DescriptionHTML database column it looks like:
<h3> Some Text </h 3> to be replaced by <h 2> Some Text </h2>
Thanks
|||
I think the pattern you are matching is only for <h3> and not </h3>. So you probably need to a double replace.
declare
@.str varchar(100)set
@.str='<h3> Some Text </h3>'--final value = <h 2> Some Text </h2>
select
@.str,replace(@.str,'<h3>','<h2>'),replace(replace(@.str,'<h3>','<h2>'),'</h3>','</h2>')|||
Hi ndinakar
Thanks for the code, but I needed to change:
@.str varchar(100)
To
@.str ntext
H
owever this change cause the code to fail:UPDATE CAT_Products
@.str ntext
set
@.str = '<h3> * </h3>'
--final value = <h 2> * </h2>
select
@.str, replace(@.str,'<h3>', '<h2>'), replace( replace(@.str,'<h3>', '<h2>'), '</h3>', '</h2>')
I got this error message:
[Error] Script lines: 1-13 --------
Line 4: Incorrect syntax near'@.str'.
More exceptions ... Must declare the variable'@.str'.
[Executed: 12/04/07 21:49:22 BST ] [Execution: 0/ms]
Try if this works:
UPDATE
CAT_Productsset
DescriptionHTML=replace(replace(DescriptionHTML,'<h3>','<h2>'),'</h3>','</h2>')WHERE
Description<>'<h2>'|||Before you try the update try a SELECT first to see what records are getting affected and how.
SELECT
NewDescriptionHTML=replace(replace(DescriptionHTML,'<h3>','<h2>'),'</h3>','</h2>'),DescriptionHTML
FROM
CAT_ProductsWHERE
Description<>'<h2>'|||As suggested, I tried this first:
SELECT
NewDescriptionHTML = replace( replace(DescriptionHTML,'<h3>', '<h2>'), '</h3>', '</h2>'),
DescriptionHTML
FROM
CAT_Products
WHERE
DescriptionHTML <> '<h2>'
But I got this error message:
[Error] Script lines: 1-11 --------
Argument data type ntext is invalid for argument 1 of replace function.
More exceptions ... The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
[Executed: 12/04/07 23:40:42 BST ] [Execution: 0/ms]
Then I tried this:
UPDATE
CAT_Products
set
DescriptionHTML = replace( replace(DescriptionHTML,'<h3>', '<h2>'), '</h3>', '</h2>')
WHERE
DescriptionHTML <> '<h2>'
But I got this error message:
[Error] Script lines: 1-11 --------
Argument data type ntext is invalid for argument 1 of replace function.
More exceptions ... The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
[Executed: 12/04/07 23:43:54 BST ] [Execution: 0/ms]
It looks like I will have to update this column manually, I had best roll up my sleeves.
Thanks
Try this:
SELECT
NewDescriptionHTML
=replace(replace(convert(varchar(4000),DescriptionHTML),'<h3>','<h2>'),'</h3>','</h2>'),DescriptionHTML
FROM
CAT_ProductsWHERE
Description<>'<h2>'|||Hi ndinakar
Thanks again for your help and support
Yes you are right the Ntext is a pain, cos when I tried your latest code suggestion I got this error:
[Error] Script lines: 1-15 --------
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
[Executed: 13/04/07 09:17:43 BST ] [Execution: 0/ms]
It certainly dose not like the NTEXT.
A cup of coffee and rolling up of the sleeves coming up.
Thanks
sql