Friday, March 30, 2012
Replacing Default Instance
tables do not have several columns required by the SQL Agent. The
corruption apparently occurred while running the SQL Wizard to convert
our 6.5 version to 2000. TO rectify the problem we successfully
installed a new instance of SQL which gave us a clean set of msdb and
master tables. We then copied our user databases over to the new
instance. My question is this: can we now make that new instance the
default instance? How can we do this? Thanks.You can't rename an instance, backup/restore is the way to go (or some simil
ar thing). Before you do that,
script out the job definitions etc from the msdb database so you can run tho
se scripts in the dest db.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jim" <jromano@.phs-us.com> wrote in message news:e1e1a687.0403241251.1c364809@.posting.googl
e.com...
> Our default instance of SQL 2000 is corrupted. The msdb database
> tables do not have several columns required by the SQL Agent. The
> corruption apparently occurred while running the SQL Wizard to convert
> our 6.5 version to 2000. TO rectify the problem we successfully
> installed a new instance of SQL which gave us a clean set of msdb and
> master tables. We then copied our user databases over to the new
> instance. My question is this: can we now make that new instance the
> default instance? How can we do this? Thanks.|||Hi ,
Add on to Tibor, Instead of moving the user databases to new named instance,
why dont you take a backup of MSDB database from the new
named instance and restore it in Default instance.
This is under the assumption only your MSDB has got issues. This case all
your Logins/Backup devices and configuration info in Master
database can be preserved.
Have a look into the below article (Just read the MSDB part only)
http://support.microsoft.com/defaul...b;EN-US;Q224071
If you have problems in detach/attach, try with backup and restore strategy.
Thanks
Hari
MCDBA
"Jim" <jromano@.phs-us.com> wrote in message
news:e1e1a687.0403241251.1c364809@.posting.google.com...
> Our default instance of SQL 2000 is corrupted. The msdb database
> tables do not have several columns required by the SQL Agent. The
> corruption apparently occurred while running the SQL Wizard to convert
> our 6.5 version to 2000. TO rectify the problem we successfully
> installed a new instance of SQL which gave us a clean set of msdb and
> master tables. We then copied our user databases over to the new
> instance. My question is this: can we now make that new instance the
> default instance? How can we do this? Thanks.
Friday, March 23, 2012
REPLACE ISSUE..
I have the following STRING - 'D or Shorty'
Struggling with the syntax required to replace the 'or' with ; without
also replacing the 'or' in 'Shorty' with ;
e.g.
ORIG STRIMG:
D or Shorty
REQUIRED STRING:
D ; Shorty
Thanks in advancehharry (paulquigley@.nyc.com) writes:
> I have the following STRING - 'D or Shorty'
> Struggling with the syntax required to replace the 'or' with ; without
> also replacing the 'or' in 'Shorty' with ;
> e.g.
> ORIG STRIMG:
> D or Shorty
> REQUIRED STRING:
> D ; Shorty
SELECT replace('D or Shorty', ' or ', ' ; ')
I would guess that your real problem is somewhat more complex, but knowing
it, it's difficult to suggest a solution.
One should be aware of that SQL Server capabilities for string
manipulation is not extremely powerful, so depending on your task,
it could be an idea to bring it client-side and use something like
Perl to do whatever you want to do.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||On 15 Mar 2005 13:30:37 -0800, hharry wrote:
> Hi All,
> I have the following STRING - 'D or Shorty'
> Struggling with the syntax required to replace the 'or' with ; without
> also replacing the 'or' in 'Shorty' with ;
> e.g.
> ORIG STRIMG:
> D or Shorty
> REQUIRED STRING:
> D ; Shorty
> Thanks in advance
DECLARE @.ss varchar(30)
SET @.ss = 'D or Shorty'
SELECT @.ss, REPLACE(@.ss, ' or ', ' ; ')
---------- --------------
D or Shorty D ; Shorty
(1 row(s) affected)|||Thanks all,
Yes, the issue is slightly more complex and I have went with this
option:
SELECT 'D or Shorty', SUBSTRING('D or Shorty', 1, CHARINDEX(' or ', 'D
or Shorty') - 1) + ' ; ' +
SUBSTRING('D or Shorty', (CHARINDEX(' or ', 'D or Shorty') + 4), LEN('D
or Shorty'))
Ross Presser wrote:
> On 15 Mar 2005 13:30:37 -0800, hharry wrote:
> > Hi All,
> > I have the following STRING - 'D or Shorty'
> > Struggling with the syntax required to replace the 'or' with ;
without
> > also replacing the 'or' in 'Shorty' with ;
> > e.g.
> > ORIG STRIMG:
> > D or Shorty
> > REQUIRED STRING:
> > D ; Shorty
> > Thanks in advance
> DECLARE @.ss varchar(30)
> SET @.ss = 'D or Shorty'
> SELECT @.ss, REPLACE(@.ss, ' or ', ' ; ')
> ----------
--------------
> D or Shorty D ; Shorty
> (1 row(s) affected)|||On 15 Mar 2005 14:47:56 -0800, hharry wrote:
> Thanks all,
> Yes, the issue is slightly more complex and I have went with this
> option:
> SELECT 'D or Shorty', SUBSTRING('D or Shorty', 1, CHARINDEX(' or ', 'D
> or Shorty') - 1) + ' ; ' +
> SUBSTRING('D or Shorty', (CHARINDEX(' or ', 'D or Shorty') + 4), LEN('D
> or Shorty'))
If your issue will come up in a similar way in the future, it might be
worth it to encapsulate that "replace first occurence only" into a UDF.
CREATE FUNCTION ReplaceFirstOccurence
( @.src varchar(8000), @.sub varchar(8000), @.repl varchar(8000) )
RETURNS varchar(8000)
AS
BEGIN
DECLARE @.n int
SET @.n = CHARINDEX(@.sub, @.src)
RETURN SUBSTRING(@.src, 1, @.n-1)
+ @.repl
+ SUBSTRING(@.src, @.n + LEN(@.sub) + 1,8000)
END
A much crazier idea that I just discovered, while googling on this topic,
is to pull in the VBScript regular expression library!
http://www.sqlteam.com/item.asp?ItemID=13947
They only demonstrate using it for testing a string against a regexp, but
it could easily be extended to use replace.