Thursday, March 22, 2012
cannot delete user & shrink log file
1. When I try to delete a user from a specific database,
it reports that that user cannot be dropped as it owns
objects. The db_owner is 'sa' not this user.
2. When I try to shrink the size of my log file, it
reports, "Cannot shrink log file 2 (cms1_log) because all
logical log files are in use."
Please help. Thanks.1. My guess is that the user own some objects. If you are used to
Enterprise Manager then expand each objects list and see if the user own
anything like "tables", "views", "store procedure", "user defined functions"
...
2. What is your recovery model? Right click server in EM, then click
properties, then options
"Rob" <rhchin@.hotmail.com> wrote in message
news:5d8901c35784$5b35fbf0$a001280a@.phx.gbl...
> Hello... I'm facing two problems:
> 1. When I try to delete a user from a specific database,
> it reports that that user cannot be dropped as it owns
> objects. The db_owner is 'sa' not this user.
> 2. When I try to shrink the size of my log file, it
> reports, "Cannot shrink log file 2 (cms1_log) because all
> logical log files are in use."
> Please help. Thanks.|||Rob,
#1..It could also be that that the user owns other objects like table,
stored procedures etc.Using the below query, you can find out the objects:
SELECT [name]
FROM sysobjects
WHERE uid=USER_ID('<user_name>')
Once there, try to change the ownership to another user, using
sp_changeobjectowner.
#2.Refer
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/support/kb/Articles/q256/6/50.asp
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/support/kb/Articles/q272/3/18.asp
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Rob" <rhchin@.hotmail.com> wrote in message
news:5d8901c35784$5b35fbf0$a001280a@.phx.gbl...
> Hello... I'm facing two problems:
> 1. When I try to delete a user from a specific database,
> it reports that that user cannot be dropped as it owns
> objects. The db_owner is 'sa' not this user.
> 2. When I try to shrink the size of my log file, it
> reports, "Cannot shrink log file 2 (cms1_log) because all
> logical log files are in use."
> Please help. Thanks.|||Thanks for your response...
>Once there, try to change the ownership to another user,
using
>sp_changeobjectowner.
I can see many objects owned by the user I wish to drop.
However, when I try to use the sp_changeobjectowner sproc,
it tells me that the object does not exist or is not a
valid object for this operation.
Thanks again.
Thursday, March 8, 2012
cannot copy sqlexpress to another pc for vb.net 2.0 project update
Hi. I have done alot of searching around but can't find answer to this specific problem.
Here is my connection string in vb.net app config
<connectionStrings>
<add name="myfile.My.MySettings.ffgscrmConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myfile.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
The database is locally attached to the vb.net project residing in a data directory in the project. I am testing installation on a virtual pc - with no sql express managment or other sql server databases attached.
When I do a vb.net setup project and run this on, there is no problem. However, once having done that, when I want to update the app, I can't just copy in the new database along with exe. I get the error:"sql server does not allow remote connections (provider:sql network interfaces error 26 - error locating server/instance specified).
Is this a problem of the virtual PC? I am testing this because I need to be able to send updates to another local machine without using setup program.
Hi,
the destination machine where you copy the files on, does that have SQL Server Express installed ? Otherwise you won′t be able to use the .\SQLEXPRESS instance which points to a local SQLExpress instance on that computer. If there is a SQLExpress instance installed on that machine, make sure you enabled remote connections on this instance. I made a screencast for that, which can be found on my site in the screencast section which will show you how to enabled the remote conenction feature.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de