Showing posts with label mdf. Show all posts
Showing posts with label mdf. Show all posts

Friday, March 23, 2012

Error on SQL .mdf update and edit - nText?

Hello anyone know how to fix this error?

The data types ntext and nvarchar are incompatible in the equal to operator.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: The data types ntext and nvarchar are incompatible in the equal to operator.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Thanks , John

An nText field can not be used in optimisitic updates. Your update statement that was generated looks something like:

UPDATE SomeTable
SET {Stuff}
WHERE nTextField=old_nTextField

And old_nTextField is defined as a nvarchar. You can't really define it as nText as nText is just a very long nvarchar field, and even if you COULD get it defined as a nText, it would still be invalid, because you can't use nText= anything, even another nText in a WHERE clause.

|||What should it be? I am now using a text , but it still does not work.|||

TEXT/NTEXT/IMAGE data in SQL Server are considered as BLOB (Binary Large Object) data and can not be used with "=" or in sorting. You may need "Text and Image Functions" to manipulate these kinds of data:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_fa-fz_0gs3.asp

Or you can convert the TEXT data (less than 8000 chars) into VARCHAR data to use it in comparation, for example:

select * from test_txt where convert(varchar(8000),t)='The index position of the value parameter if that string is found, or -1 if it is not. If value is Empty, the return value is 0.'

Or use LIKE operator:

select * from test_txt where t like 'The index position of the value parameter if that string is found, or -1 if it is not. If value is Empty, the return value is 0.'

Monday, March 19, 2012

Error on Attaching SQL server 2005 DB

Hai

When i try to attach (using raw .mdf & .ldf) DB that was detached from another SQL Server 2005 instance. I got this error

The database 'Content' cannot be opened because it is version 611. This server supports version 603 and earlier. A downgrade path is not supported.
Could not open new database 'Content'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)

How can i slove this Error?

Regards

It appears you are attempting to attach to some pre-RTM version of SQL.

You'll want to ensure that you are using the released version of SQL2005, and not a previous beta/ctp version.

Error on Attaching SQL server 2005 DB

Hai

When i try to attach (using raw .mdf & .ldf) DB that was detached from another SQL Server 2005 instance. I got this error

The database 'Content' cannot be opened because it is version 611. This server supports version 603 and earlier. A downgrade path is not supported.
Could not open new database 'Content'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)

How can i slove this Error?

Regards

It appears you are attempting to attach to some pre-RTM version of SQL.

You'll want to ensure that you are using the released version of SQL2005, and not a previous beta/ctp version.

Error on attaching a database

When attaching a database that was detached from another SQL Server instance(copied raw .mdf and ldf files)..

I got the error message below:

Error 602: Could not find row in sysindexes for database ID 25, object ID 1,
index ID 1. Run DBCC CHECKTABLE on sysindexes.

how can i solve this problem. i am using SQL Server 2000

Thanks and Regards

hi,

Could you be more specific. How did you detached the your database? Did you do it by backup and restore or copy the .mdf and .ldf file and attached.

Michael Castillones

|||

hai oblax77

I copied raw .mdf and ldf files.

Regards

|||

hi,

Maybe your database was corrupted because the errors includes the system indexes already.

Error on attaching a database

When attaching a database that was detached from another SQL Server instance(copied raw .mdf and ldf files)..

I got the error message below:

Error 602: Could not find row in sysindexes for database ID 25, object ID 1,
index ID 1. Run DBCC CHECKTABLE on sysindexes.

how can i solve this problem. i am using SQL Server 2000

Thanks and Regards

hi,

Could you be more specific. How did you detached the your database? Did you do it by backup and restore or copy the .mdf and .ldf file and attached.

Michael Castillones

|||

hai oblax77

I copied raw .mdf and ldf files.

Regards

|||

hi,

Maybe your database was corrupted because the errors includes the system indexes already.

ERROR on atach MDF file!

Code Snippet

TITLE: Microsoft SQL Server Management Studio

Attach database failed for Server 'MS-DB'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476


ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not redo log record (805:390:13), for transaction ID (0:55765), on page (1:1061), database 'aws' (database ID 5). Page: LSN = (804:451:25), type = 2. Log: OpCode = 2, context 3, PrevPageLSN: (805:150:13). Restore from a backup of the database, or repair the database.
During redoing of a logged operation in database 'aws', an error occurred at log record ID (805:390:13). Typically, the specific failure is previously logged as an error in the Windows Event Log service. Restore the database from a full backup, or repair the database.
Could not open new database 'aws'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 3456)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=3456&LinkId=20476


BUTTONS:

OK

HELP ME!!

try to attach only the mdf file of your database.

run a command like this :

create database yourdb on (name =yourdb, filename='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\yourmdffile.mdf') for attach

If it doesn't work do what your message say

|||

Don't work...

The message....

Code Snippet

Msg 1813, Level 16, State 2, Line 1

Could not open new database 'aws'. CREATE DATABASE is aborted.

Msg 3456, Level 21, State 1, Line 1

Could not redo log record (805:390:13), for transaction ID (0:55765), on page (1:1061), database 'aws' (database ID 5). Page: LSN = (804:451:25), type = 2. Log: OpCode = 2, context 3, PrevPageLSN: (805:150:13). Restore from a backup of the database, or repair the database.

Msg 3313, Level 21, State 2, Line 1

During redoing of a logged operation in database 'aws', an error occurred at log record ID (805:390:13). Typically, the specific failure is previously logged as an error in the Windows Event Log service. Restore the database from a full backup, or repair the database.

|||

A last try :

when i said to attach only the mdf file i thaught to following thing:

don't use the log file when making the operation of attaching (put only de mdf file in the folder); so , SQL should recreate the log file.

|||

Ok,

I try this...

and

Code Snippet

File activation failure. The physical file name "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\aws_log.ldf" may be incorrect.

The log cannot be rebuilt because the database was not cleanly shut down.

Msg 1813, Level 16, State 2, Line 1

Could not open new database 'aws'. CREATE DATABASE is aborted.

|||

If you have not a backup try to recover with third party. It say :

"Selective recovery means repairing only those transactions and objects that are damaged" Maybe they can help you.

To the other part you have to review the procedures of using servers in your organization (using UPS etc) because "the database was not cleanly shutdown"

|||

As your db was not cleanly shut down you can perform as below

(a) Create a database with the same name in another directory as the one you're trying to attach
(b) Re-create all filesgroups and files as necessary
(c) Shutdown the server
(d) Swap in the old mdf file and any ndf files
(e) Bring up the server and let the database attempt to be recovered and then go into suspect
(f) Put the database in single-user mode.
(g) Run DBCC CHECKDB (dbname, REPAIR_ALLOW_DATA_LOSS) which will rebuild the log and run full repair
(h) Return database to online, multi-user mode.

|||

As your db was not cleanly shut down you can perform as below

ok(a) Create a database with the same name in another directory as the one you're trying to attach
ok(b) Re-create all filesgroups and files as necessary
ok(c) Shutdown the server
ok(d) Swap in the old mdf file and any ndf files
ok(e) Bring up the server and let the database attempt to be recovered and then go into suspect
(f) Put the database in single-user mode.

Well

I cant put the database in single-user mode, i receive this message whend i did this commands...

Commands:

Use aws

go

sp_dboption 'aws', 'dbo use only', false

go

sp_dboption 'aws','single_user', true

go

dbcc checkdb ('aws',repair_allow_data_loss)


aws is my DB


Message:

Msg 926, Level 14, State 1, Line 1
Database 'aws' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.
Msg 926, Level 14, State 1, Line 1
Database 'aws' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
sp_dboption command failed.
Msg 3456, Level 21, State 1, Line 1
Could not redo log record (805:390:13), for transaction ID (0:55765), on page (1:1061), database 'aws' (database ID 5). Page: LSN = (804:451:25), type = 2. Log: OpCode = 2, context 3, PrevPageLSN: (805:150:13). Restore from a backup of the database, or repair the database.
Msg 3313, Level 21, State 2, Line 1
During redoing of a logged operation in database 'aws', an error occurred at log record ID (805:390:13). Typically, the specific failure is previously logged as an error in the Windows Event Log service. Restore the database from a full backup, or repair the database.
Msg 3414, Level 21, State 1, Line 1
An error occurred during recovery, preventing the database 'aws' (database ID 5) from restarting. Diagnose the recovery errors and fix them, or restore from a known good backup. If errors are not corrected or expected, contact Technical Support.

===================

Then i put the server in Single User mode and execute the command below: ( -m -c )


DBCC CHECKDB (aws, REPAIR_ALLOW_DATA_LOSS)


and receive this message:


Msg 926, Level 14, State 1, Line 1
Database 'aws' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.


======


Well

The DB was atach again, but i cant recovery the data =(

Sunday, March 11, 2012

Error number: 1105 the primary group is full

Hi i am Oscar,
I have a problem with database Subscriber. I've created this database with
2 datafile (*.mdf). the first datafile has static size and second datafile
is define with unrestrictec file growth option . the replication have been
worked all time, until the disc has fulled. How is possible that database
Published has 1928 Mb size and Subscriber database grows up a lot of?
Have i configured something in Suscriber database?
Could you help me , please?
Best Regards
Message posted via http://www.sqlmonster.com
Very odd . On the subscriber are there any other tables which are not part
of the publication?
Also, please use sp_spaceused on the publisher and subscriber and post up
the results.
HTH,
Paul Ibison SQL Server MVP,
www.replicationanswers.com/default.asp
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||well paul,
I have executed this storage procedure in Publisher and Suscriber y this
the results
Publishers.
BDIntranet8577.38 MB51.54 MB
1921176 KB973024 KB281384 KB666768 KB
Suscriber.
BDIntranet 55386.75 MB2567.94 MB
52550464 KB52194688 KB230888 KB124888 KB
There is datafile that it?s growing too much. i do not understand Why?
Best Regards,
oscar
Message posted via http://www.sqlmonster.com
|||I was expecting that most of the extra space would be unallocated, but that
is simply not the case. You have 44GB more space used on the subscriber.
Perhaps it is being used for other things apart from this subscription? Or
else you are not replicating deletes, and the subscriber holds all the
original data, much of which has been removed from the publisher?
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com/default.asp
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)