Showing posts with label associated. Show all posts
Showing posts with label associated. Show all posts

Monday, March 26, 2012

Rename MDF file

Is there a way to rename the mdf and ldf files associated with a databse.
Also can I rename the fil nemae that is created for these when the databse
gets created.you can detach the database
rename the files
attach the database by specifying the new file names
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.|||To add to Jj's response, you can rename logical file names with ALTER
DATABASE. For example:
ALTER DATABASE MyDatabase
MODIFY FILE(
NAME='MyOldLogicalName',
NEWNAME='MyNewLogicalName')
See the Books online for more information.
Hope this helps.
Dan Guzman
SQL Server MVP
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.

Rename MDF file

Is there a way to rename the mdf and ldf files associated with a databse.
Also can I rename the fil nemae that is created for these when the databse
gets created.
you can detach the database
rename the files
attach the database by specifying the new file names
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.
|||To add to Jj's response, you can rename logical file names with ALTER
DATABASE. For example:
ALTER DATABASE MyDatabase
MODIFY FILE(
NAME='MyOldLogicalName',
NEWNAME='MyNewLogicalName')
See the Books online for more information.
Hope this helps.
Dan Guzman
SQL Server MVP
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.

Rename MDF file

Is there a way to rename the mdf and ldf files associated with a databse.
Also can I rename the fil nemae that is created for these when the databse
gets created.you can detach the database
rename the files
attach the database by specifying the new file names
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.|||To add to Jéjé's response, you can rename logical file names with ALTER
DATABASE. For example:
ALTER DATABASE MyDatabase
MODIFY FILE(
NAME='MyOldLogicalName',
NEWNAME='MyNewLogicalName')
See the Books online for more information.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.

Friday, March 9, 2012

removing old logins

Using SS2000. I'm removing old logins. When I tried to remove one, I receive
d this message "removing tis login will remove all associated database users
(if any)."
What does this mean?
Thanks,
--
Dan D.Hi,
This error will come when the user has been allocated permissions to some
other databases. So you have to
drop the user associated to that login from all the databases and then drop
the login.
Command to get the databases user is mapped
sp_helplogins <logn_name>
Then use have to go to each database and drop the user
use <dbname>
go
sp_dropuser <user_name>
Once you drop the user from all the databases you could drop the login..
sp_droplogin <login_name>
Thanks
Hari
MCDBA
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:DC4A9B5E-2EB5-40E6-9BD1-F4A9AC51E63D@.microsoft.com...
> Using SS2000. I'm removing old logins. When I tried to remove one, I
received this message "removing tis login will remove all associated
database users (if any)."
> What does this mean?
> Thanks,
> --
> Dan D.|||I understand. Makes perfect sense.
Thanks,
--
Dan D.
"Hari Prasad" wrote:

> Hi,
> This error will come when the user has been allocated permissions to some
> other databases. So you have to
> drop the user associated to that login from all the databases and then dro
p
> the login.
> Command to get the databases user is mapped
> sp_helplogins <logn_name>
> Then use have to go to each database and drop the user
> use <dbname>
> go
> sp_dropuser <user_name>
> Once you drop the user from all the databases you could drop the login..
> sp_droplogin <login_name>
> Thanks
> Hari
> MCDBA
>
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:DC4A9B5E-2EB5-40E6-9BD1-F4A9AC51E63D@.microsoft.com...
> received this message "removing tis login will remove all associated
> database users (if any)."
>
>

removing old logins

Using SS2000. I'm removing old logins. When I tried to remove one, I received this message "removing tis login will remove all associated database users (if any)."
What does this mean?
Thanks,
Dan D.
Hi,
This error will come when the user has been allocated permissions to some
other databases. So you have to
drop the user associated to that login from all the databases and then drop
the login.
Command to get the databases user is mapped
sp_helplogins <logn_name>
Then use have to go to each database and drop the user
use <dbname>
go
sp_dropuser <user_name>
Once you drop the user from all the databases you could drop the login..
sp_droplogin <login_name>
Thanks
Hari
MCDBA
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:DC4A9B5E-2EB5-40E6-9BD1-F4A9AC51E63D@.microsoft.com...
> Using SS2000. I'm removing old logins. When I tried to remove one, I
received this message "removing tis login will remove all associated
database users (if any)."
> What does this mean?
> Thanks,
> --
> Dan D.
|||I understand. Makes perfect sense.
Thanks,
Dan D.
"Hari Prasad" wrote:

> Hi,
> This error will come when the user has been allocated permissions to some
> other databases. So you have to
> drop the user associated to that login from all the databases and then drop
> the login.
> Command to get the databases user is mapped
> sp_helplogins <logn_name>
> Then use have to go to each database and drop the user
> use <dbname>
> go
> sp_dropuser <user_name>
> Once you drop the user from all the databases you could drop the login..
> sp_droplogin <login_name>
> Thanks
> Hari
> MCDBA
>
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:DC4A9B5E-2EB5-40E6-9BD1-F4A9AC51E63D@.microsoft.com...
> received this message "removing tis login will remove all associated
> database users (if any)."
>
>

removing old logins

Using SS2000. I'm removing old logins. When I tried to remove one, I received this message "removing tis login will remove all associated database users (if any)."
What does this mean?
Thanks,
--
Dan D.Hi,
This error will come when the user has been allocated permissions to some
other databases. So you have to
drop the user associated to that login from all the databases and then drop
the login.
Command to get the databases user is mapped
sp_helplogins <logn_name>
Then use have to go to each database and drop the user
use <dbname>
go
sp_dropuser <user_name>
Once you drop the user from all the databases you could drop the login..
sp_droplogin <login_name>
Thanks
Hari
MCDBA
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:DC4A9B5E-2EB5-40E6-9BD1-F4A9AC51E63D@.microsoft.com...
> Using SS2000. I'm removing old logins. When I tried to remove one, I
received this message "removing tis login will remove all associated
database users (if any)."
> What does this mean?
> Thanks,
> --
> Dan D.