Showing posts with label restored. Show all posts
Showing posts with label restored. Show all posts

Sunday, March 25, 2012

Changing the logical name of a DB

Hi,
I recently restored one DB over another different one in order to import a
template of data into a new DB. I did this in Enterprise Manager. The gui
allowed me to change the physical file path & name to match the destination
file, but didn't allow me to change the logical name.
How can I now change the logical file names of the data & log files?
Many thanks for any help
You should do your best to learn the DDL equivalents of pointing and
clicking in the GUI, for two reasons: (a) you can easily store your scripts
in source control, and (b) you will have access to parts of the
functionality that didn't make it into the interface. Try this in Query
Analyzer:
ALTER DATABASE Database_Name
MODIFY FILE
(
NAME = Logical_Name,
NEWNAME = NEW_Logical_Name
);
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
> Hi,
> I recently restored one DB over another different one in order to import a
> template of data into a new DB. I did this in Enterprise Manager. The gui
> allowed me to change the physical file path & name to match the
> destination
> file, but didn't allow me to change the logical name.
> How can I now change the logical file names of the data & log files?
> Many thanks for any help
|||> How can I now change the logical file names of the data & log files?
You can use ALTER DATABASE...MODIFY FILE. For example:
ALTER DATABASE AdventureWorks
MODIFY FILE (
NAME='AdventureWorks_Data',
NEWNAME='AdventureWorks_Data_New')
See ALTER DATABASE in the Books Online for details.
Hope this helps.
Dan Guzman
SQL Server MVP
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
> Hi,
> I recently restored one DB over another different one in order to import a
> template of data into a new DB. I did this in Enterprise Manager. The gui
> allowed me to change the physical file path & name to match the
> destination
> file, but didn't allow me to change the logical name.
> How can I now change the logical file names of the data & log files?
> Many thanks for any help
|||Hello Dan,
Thank you very much for your help here.
Cheers
Ant
"Dan Guzman" wrote:

> You can use ALTER DATABASE...MODIFY FILE. For example:
> ALTER DATABASE AdventureWorks
> MODIFY FILE (
> NAME='AdventureWorks_Data',
> NEWNAME='AdventureWorks_Data_New')
> See ALTER DATABASE in the Books Online for details.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ant" <Ant@.discussions.microsoft.com> wrote in message
> news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
>
|||What version are you running?
In SQL 2000 you cannot change the logical file names.
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
> Hi,
> I recently restored one DB over another different one in order to import a
> template of data into a new DB. I did this in Enterprise Manager. The gui
> allowed me to change the physical file path & name to match the
> destination
> file, but didn't allow me to change the logical name.
> How can I now change the logical file names of the data & log files?
> Many thanks for any help
|||Hi Kalen,
Thanks for the reply but in fact it appears you can. I am using SQL 2000 &
have successfully changed the logical name simply by using the Alter table
modify file statement I was given above. It worked fine!
Thank you any way for your input on this though.
Cheer
Ant
"Kalen Delaney" wrote:

> What version are you running?
> In SQL 2000 you cannot change the logical file names.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.InsideSQLServer.com
> http://blog.kalendelaney.com
>
> "Ant" <Ant@.discussions.microsoft.com> wrote in message
> news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
>
>
|||Hi, Kalen.

> What version are you running?
> In SQL 2000 you cannot change the logical file names.
Perhaps you are thinking of SQL 7. IIRC, the ability to change the logical
names was introduced in SQL 2000.
Hope this helps.
Dan Guzman
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%23dlcDj1UIHA.5980@.TK2MSFTNGP04.phx.gbl...
> What version are you running?
> In SQL 2000 you cannot change the logical file names.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.InsideSQLServer.com
> http://blog.kalendelaney.com
>
> "Ant" <Ant@.discussions.microsoft.com> wrote in message
> news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
>
|||You're right... as Dan indicated it was actually SQL 7, when the new files
structures and ALTER DATABASE command were first introduced, that there was
no way to change the logical name.
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:B2DD5503-5FC5-4B16-8B3B-C38655367FDF@.microsoft.com...[vbcol=seagreen]
> Hi Kalen,
> Thanks for the reply but in fact it appears you can. I am using SQL 2000 &
> have successfully changed the logical name simply by using the Alter table
> modify file statement I was given above. It worked fine!
> Thank you any way for your input on this though.
> Cheer
> Ant
> "Kalen Delaney" wrote:
|||Thanks, Dan.
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:C6D04793-D874-4B42-A440-ED117325CE42@.microsoft.com...
> Hi, Kalen.
>
> Perhaps you are thinking of SQL 7. IIRC, the ability to change the
> logical names was introduced in SQL 2000.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:%23dlcDj1UIHA.5980@.TK2MSFTNGP04.phx.gbl...
>

Changing the logical name of a DB

Hi,
I recently restored one DB over another different one in order to import a
template of data into a new DB. I did this in Enterprise Manager. The gui
allowed me to change the physical file path & name to match the destination
file, but didn't allow me to change the logical name.
How can I now change the logical file names of the data & log files?
Many thanks for any helpYou should do your best to learn the DDL equivalents of pointing and
clicking in the GUI, for two reasons: (a) you can easily store your scripts
in source control, and (b) you will have access to parts of the
functionality that didn't make it into the interface. Try this in Query
Analyzer:
ALTER DATABASE Database_Name
MODIFY FILE
(
NAME = Logical_Name,
NEWNAME = NEW_Logical_Name
);
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
> Hi,
> I recently restored one DB over another different one in order to import a
> template of data into a new DB. I did this in Enterprise Manager. The gui
> allowed me to change the physical file path & name to match the
> destination
> file, but didn't allow me to change the logical name.
> How can I now change the logical file names of the data & log files?
> Many thanks for any help|||> How can I now change the logical file names of the data & log files?
You can use ALTER DATABASE...MODIFY FILE. For example:
ALTER DATABASE AdventureWorks
MODIFY FILE (
NAME='AdventureWorks_Data',
NEWNAME='AdventureWorks_Data_New')
See ALTER DATABASE in the Books Online for details.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
> Hi,
> I recently restored one DB over another different one in order to import a
> template of data into a new DB. I did this in Enterprise Manager. The gui
> allowed me to change the physical file path & name to match the
> destination
> file, but didn't allow me to change the logical name.
> How can I now change the logical file names of the data & log files?
> Many thanks for any help|||Hello Dan,
Thank you very much for your help here.
Cheers
Ant
"Dan Guzman" wrote:
> > How can I now change the logical file names of the data & log files?
> You can use ALTER DATABASE...MODIFY FILE. For example:
> ALTER DATABASE AdventureWorks
> MODIFY FILE (
> NAME='AdventureWorks_Data',
> NEWNAME='AdventureWorks_Data_New')
> See ALTER DATABASE in the Books Online for details.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ant" <Ant@.discussions.microsoft.com> wrote in message
> news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
> > Hi,
> > I recently restored one DB over another different one in order to import a
> > template of data into a new DB. I did this in Enterprise Manager. The gui
> > allowed me to change the physical file path & name to match the
> > destination
> > file, but didn't allow me to change the logical name.
> >
> > How can I now change the logical file names of the data & log files?
> >
> > Many thanks for any help
>|||What version are you running?
In SQL 2000 you cannot change the logical file names.
--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
> Hi,
> I recently restored one DB over another different one in order to import a
> template of data into a new DB. I did this in Enterprise Manager. The gui
> allowed me to change the physical file path & name to match the
> destination
> file, but didn't allow me to change the logical name.
> How can I now change the logical file names of the data & log files?
> Many thanks for any help|||Hi Kalen,
Thanks for the reply but in fact it appears you can. I am using SQL 2000 &
have successfully changed the logical name simply by using the Alter table
modify file statement I was given above. It worked fine!
Thank you any way for your input on this though.
Cheer
Ant
"Kalen Delaney" wrote:
> What version are you running?
> In SQL 2000 you cannot change the logical file names.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.InsideSQLServer.com
> http://blog.kalendelaney.com
>
> "Ant" <Ant@.discussions.microsoft.com> wrote in message
> news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
> > Hi,
> > I recently restored one DB over another different one in order to import a
> > template of data into a new DB. I did this in Enterprise Manager. The gui
> > allowed me to change the physical file path & name to match the
> > destination
> > file, but didn't allow me to change the logical name.
> >
> > How can I now change the logical file names of the data & log files?
> >
> > Many thanks for any help
>
>|||Hi, Kalen.
> What version are you running?
> In SQL 2000 you cannot change the logical file names.
Perhaps you are thinking of SQL 7. IIRC, the ability to change the logical
names was introduced in SQL 2000.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%23dlcDj1UIHA.5980@.TK2MSFTNGP04.phx.gbl...
> What version are you running?
> In SQL 2000 you cannot change the logical file names.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.InsideSQLServer.com
> http://blog.kalendelaney.com
>
> "Ant" <Ant@.discussions.microsoft.com> wrote in message
> news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
>> Hi,
>> I recently restored one DB over another different one in order to import
>> a
>> template of data into a new DB. I did this in Enterprise Manager. The gui
>> allowed me to change the physical file path & name to match the
>> destination
>> file, but didn't allow me to change the logical name.
>> How can I now change the logical file names of the data & log files?
>> Many thanks for any help
>|||You're right... as Dan indicated it was actually SQL 7, when the new files
structures and ALTER DATABASE command were first introduced, that there was
no way to change the logical name.
--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Ant" <Ant@.discussions.microsoft.com> wrote in message
news:B2DD5503-5FC5-4B16-8B3B-C38655367FDF@.microsoft.com...
> Hi Kalen,
> Thanks for the reply but in fact it appears you can. I am using SQL 2000 &
> have successfully changed the logical name simply by using the Alter table
> modify file statement I was given above. It worked fine!
> Thank you any way for your input on this though.
> Cheer
> Ant
> "Kalen Delaney" wrote:
>> What version are you running?
>> In SQL 2000 you cannot change the logical file names.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>> www.InsideSQLServer.com
>> http://blog.kalendelaney.com
>>
>> "Ant" <Ant@.discussions.microsoft.com> wrote in message
>> news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
>> > Hi,
>> > I recently restored one DB over another different one in order to
>> > import a
>> > template of data into a new DB. I did this in Enterprise Manager. The
>> > gui
>> > allowed me to change the physical file path & name to match the
>> > destination
>> > file, but didn't allow me to change the logical name.
>> >
>> > How can I now change the logical file names of the data & log files?
>> >
>> > Many thanks for any help
>>|||Thanks, Dan.
--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:C6D04793-D874-4B42-A440-ED117325CE42@.microsoft.com...
> Hi, Kalen.
>> What version are you running?
>> In SQL 2000 you cannot change the logical file names.
> Perhaps you are thinking of SQL 7. IIRC, the ability to change the
> logical names was introduced in SQL 2000.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:%23dlcDj1UIHA.5980@.TK2MSFTNGP04.phx.gbl...
>> What version are you running?
>> In SQL 2000 you cannot change the logical file names.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>> www.InsideSQLServer.com
>> http://blog.kalendelaney.com
>>
>> "Ant" <Ant@.discussions.microsoft.com> wrote in message
>> news:8FFB9324-E3A9-4676-81C4-C8970539AC54@.microsoft.com...
>> Hi,
>> I recently restored one DB over another different one in order to import
>> a
>> template of data into a new DB. I did this in Enterprise Manager. The
>> gui
>> allowed me to change the physical file path & name to match the
>> destination
>> file, but didn't allow me to change the logical name.
>> How can I now change the logical file names of the data & log files?
>> Many thanks for any help
>>
>

Monday, March 19, 2012

Changing SQL 2000 Server colation - urgent!

Hi,
I've installed the SQL 2000 Server with SQL_Latin1_General_CP1_CI_AS
collation.
I've restored databases from different server with Hebrew_CI_AS collation,
and there is a oproblem to see Hebrew characters in the databases.
Can i change the collation for entire server (preferably without reboot) in
order to see characters well in all DBs and how exactly can i do that?
Or i need to make the collation change for every DB separately, and how it
can be done?
Thanks,
BarakBarak Turovsky wrote:
> Hi,
> I've installed the SQL 2000 Server with SQL_Latin1_General_CP1_CI_AS
> collation.
> I've restored databases from different server with Hebrew_CI_AS
> collation, and there is a oproblem to see Hebrew characters in the
> databases.
> Can i change the collation for entire server (preferably without
> reboot) in order to see characters well in all DBs and how exactly
> can i do that?
> Or i need to make the collation change for every DB separately, and
> how it can be done?
See "How to transfer a database from one collation to another collation in
SQL Server"
http://support.microsoft.com/?kbid=325335#8
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.|||Shalom,Barak
Try to use ALTER TABLE command with the option to change COLLATION.
Did you try to change these column to NVARCHAR datatype to see if you can
see the data?
Did you have your Server as 'Hebrew Enabled'?
You may encounter some problems when you try to JOIN the columns with
differnt collations.
"Barak Turovsky" <baraktur@.mail.ru> wrote in message
news:#1lWDgLEEHA.2576@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I've installed the SQL 2000 Server with SQL_Latin1_General_CP1_CI_AS
> collation.
> I've restored databases from different server with Hebrew_CI_AS collation,
> and there is a oproblem to see Hebrew characters in the databases.
> Can i change the collation for entire server (preferably without reboot)
in
> order to see characters well in all DBs and how exactly can i do that?
> Or i need to make the collation change for every DB separately, and how it
> can be done?
> Thanks,
> Barak
>