Showing posts with label mistake. Show all posts
Showing posts with label mistake. Show all posts

Monday, March 19, 2012

how to detach a read only database from Sql Express

Need help

I made a mistake an attached a read only database to the server (now it is grey marked).

When I try to select this read only database in the MS SQL Server Management Studio, the server hangs up.

I removed the read only attribute from the .mdf and .ldf File and made a reboot of the server. Still the same problem.

How can I detach this read only database or how can I set the attribute to read/write (always hangs up the server, when I try to access this db)

I tried also:

alter database readOnly_dbname set read_write

or

USE master;
GO
EXEC sp_dboption 'readOnly_dbname', 'read only', 'FALSE';

Many thanks for an answer.

Kusi

Did you use sp_detachdb 'DbName' ?


Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

I have the same problem. In management studio, the only thing that you can do is to make delete on the read-only database. You will have an error, but the database will be well released from SQL Server. I didn't find a way to make it back non read-only... by scripting or in the management studio.

Someone has a solution for that problem?

|||

I found a solution. The issue is related to the files security.

Be sure that the .mdf and .ldf files have the NETWORK SERVICE and the SQLServer2005MSSQLUser$YourPc$YourSqlInstanceName security users with Full Control permission checked on them.

Wednesday, March 7, 2012

how to delete reference to fulltext catalog

Looks like I made a mistake I hope someone can help me with. I backed
up a SQL database that implements fulltext catalogs. I thought these
would be included in the backup...I was wrong. Not a problem to
recreate the catalogs except that the database still shows the
references to the old ones. It gives me an error if I try to delete. I
get an error if I try to rebuild. I have also tried command line with
no luck:
use dev_i3
EXEC sp_fulltext_catalog 'fcAttachment', 'drop'
I appear to be stuck because I have catalog references to catalogs that
do not exist on the new server. There must be a way to manually remove
this reference and start over...I hope!
Thanks in advance.
I hope you have found a solution but if not here's my 2 cents...
First, you'll want to double-check that full-text is enabled on the database
in the new server. (see sp_fulltext_database in BOL) If not, do so and try
once more to start a rebuild on the catalogs. If this doesn't work, you'll
need to manually delete the catalogs from the sysfulltextcatalogs table and
recreate the full-text catalogs (see sp_fulltext_catalog). This should get
your catalogs back online.
Thankfully, in SQL Server 2005, the FT catalogs will be backed up and
restored as part of the database.

Friday, February 24, 2012

How to delete duplicate record

I have table by mistake i have lot of duplicate records. How do i delete it
.?
Thanks
Jayhttp://www.aspfaq.com/2431
Then
http://www.aspfaq.com/2509
"Jay Villa" <jayvilla@.community.nospam> wrote in message
news:OFz5HZonFHA.2080@.TK2MSFTNGP14.phx.gbl...
>I have table by mistake i have lot of duplicate records. How do i delete it
>.?
> Thanks
> Jay
>|||Jay,
Could you post the structure of your table. It would be helpful to know the
column names and primary key columns involved.
Thanks,
Frank Castora
"Jay Villa" <jayvilla@.community.nospam> wrote in message
news:OFz5HZonFHA.2080@.TK2MSFTNGP14.phx.gbl...
>I have table by mistake i have lot of duplicate records. How do i delete it
>.?
> Thanks
> Jay
>|||Frank
Table looks like this
cbbdacc_account_id --> PK
cbbdacc_desc
cbbdacc_resp_pidm
cbbdacc_balance
-Jay
"Frank Castora" <fccsql@.hotmail.com> wrote in message
news:%23BFoubonFHA.860@.TK2MSFTNGP12.phx.gbl...
> Jay,
> Could you post the structure of your table. It would be helpful to know
> the column names and primary key columns involved.
> Thanks,
> Frank Castora
> "Jay Villa" <jayvilla@.community.nospam> wrote in message
> news:OFz5HZonFHA.2080@.TK2MSFTNGP14.phx.gbl...
>|||> cbbdacc_account_id --> PK
Is this an IDENTITY column? Do you need to maintain existing values? If
so, how do you decide which ID # you need to keep?

> cbbdacc_desc
> cbbdacc_resp_pidm
> cbbdacc_balance
Is a row considered a "duplicate" when all three of these columns are
identical in the two rows, or some subset?|||I respectfully defer to Aaron, as the articles he pointed you too are quite
sufficient. :)
Thanks,
Frank Castora
"Jay Villa" <jayvilla@.community.nospam> wrote in message
news:%23AN4KionFHA.4056@.TK2MSFTNGP10.phx.gbl...
> Frank
> Table looks like this
> cbbdacc_account_id --> PK
> cbbdacc_desc
> cbbdacc_resp_pidm
> cbbdacc_balance
>
> -Jay
>
> "Frank Castora" <fccsql@.hotmail.com> wrote in message
> news:%23BFoubonFHA.860@.TK2MSFTNGP12.phx.gbl...
>|||Hi Aaron,
You may want to add:
WITH JustDups AS
(
SELECT * FROM T1 AS A
WHERE surkey <
(SELECT MAX(surkey) FROM T1 AS B
WHERE B.wannabekey = A.wannabekey)
)
DELETE FROM JustDups;
:)
--
BG, SQL Server MVP
www.SolidQualityLearning.com
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%23zpiXaonFHA.1968@.TK2MSFTNGP14.phx.gbl...
> http://www.aspfaq.com/2431
> Then
> http://www.aspfaq.com/2509
>
>
> "Jay Villa" <jayvilla@.community.nospam> wrote in message
> news:OFz5HZonFHA.2080@.TK2MSFTNGP14.phx.gbl...
>