Compact And Repair Database

Aug 17, 2004

I'm an Access man moving towards SQL Server and I'm interested in knowing if there is a utility for my SQL Server version 7 database that is similar to Access' Compact and Repair utility? I'd like a recommendation from a guru on what Prevenatative Maintenance measures I should be running daily/weekly/monthly etc...

Thanks in advance.
dog

View 3 Replies


ADVERTISEMENT

Compact And Repair Database ?

Aug 29, 2006

I want to use function "Compact and repair database" in SQL Server2000 which like function Access 2003.
How can i do ?
Thank you very much.

View 2 Replies View Related

Compact And Repair In An Adp

Apr 5, 2007

Hi,I just deleted about 1 million records from a SQL Server 2000 database. Iaccess it using Access 2000.I have Compact and Repair available in the adp under Tools. Should I do thatfrom Access? Will it not mess anything up?Thanks!J~

View 2 Replies View Related

Reseting The Auto-Number For A Table Back To Zero And Compact/Repair Or Unload/Reload For SQL Server 2000.

Mar 6, 2007

After deleting all the test data from all tables in a SQL 2000 database, is there a way to reset all the auto-incrementing fields back to zero in one shot? In Access, you can run the Compact and Repair option. Also, in Sybase SQL, there was an "unload/reload" option to reduce the database size. Is there a similar function in SQL2000? Thanks for all the help

View 1 Replies View Related

Error Message Run Repair Utility When Using Sqlceengine.repair

Sep 26, 2007



Hi there.

I have a corrupt .sdf database sat on a SD Card but i am unable to find a way to repair it.

So far I have tried a few different methods, most of which just tell me what i already know i.e. "the database is corrupt and needs repairing!!"

I am unable to open the file in SSMS object browser (see above message) which means i cant run repair / shrink utilites.
I am also unable to add the database to a vs2005 project (again see above message) meaning again i can't run any repair utilities.

I have also tried using the compact / Repair utility in Query analyser 3.0 on my Windows Mobile 5.0 PDA but once again i am greeted with an "error reading file - Run the Repair Utility" Message.

Lastly i've tried using the SQLCEengine.repair method and, depending on whether i do it on the PDA or on a desktop pc it throws the exceptions "Error occurred reading database file - run the repair utility"(PDA) or "invalid database type" (PC)

Can anyone shed any light as to whether there is another (easier???) way of doing this or if i just have to face it that this file is lost?

Thanks

ps. the code i used for the .repair is as below:



Dim conn As SqlCeEngine

Dim strdb As String



strdb = "SD CardPathnameDatabase.sdf"



conn = New SqlCeEngine(String.Format("Data Source={0}", strdb))


If conn.Verify = False Then

conn.Repair(Nothing, RepairOption.RecoverCorruptedRows)

MsgBox("Successfully Repaired")


End If

View 8 Replies View Related

Database Repair - Need Help Please!

Apr 28, 2008

I started getting errors everytime i try to access my webmail(horde), my zencart and my forum so i asked my website host and they say i need to repair the SQL database. I have no idea what this means, can someone help please?

The errors are:

Horde: A fatal error has occurred
Could not connect to database for SQL SessionHandler.
Details have been logged for the administrator.

Zencart: 0 DB_ERROR_NOT_CONNECTED
in:
[db_cache table]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

SMF Forum: Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

Please help, i am totally lost!

View 12 Replies View Related

Repair Corrupted Database?

Mar 20, 2000

I am backing up SQL 6.5 DB using Backup Exec 7.2 on NT 4.0 server SP4 with SQL server agent. The backup job ends in Failed status and a warning that DBname is corrupt. I then try to run DBCC Checkdb, newalloc, and checkcatalog commands to repair the DB. No further ahead yet. Are there any other commands that I can perform on the DB so that the corruption can be repaired, or verified there indeed is corruption of DB?

View 1 Replies View Related

The Database File May Be Corrupted. Run The Repair Utility To Check The Database File. [ Database Name = SDMMC Storage Cardwinp

Oct 9, 2007

yes,I have an error, like 'The database file may be corrupted. Run the repair utility to check the database file. [ Database name = SDMMC Storage Cardwinpos_2005WINPOS2005.sdf ]' .I develope a program for Pocket Pcs and this program's database sometimes corrupt.what can i do?please help me

View 4 Replies View Related

Suspect Database - How To Retrieve And Repair

Apr 24, 2000

Running SQL 7, Standard version. I had a database marked 'suspect'. I copied the MDF and LDF files to another directory, then deleted the suspect database. I tried to create a new database and attach the MDF file to it. It did not work. Any other ideas? I have no other backups of the data. I am willing to pay for consulting over the phone if necessary.

View 1 Replies View Related

Repair Database And Delete Transaction Log

Nov 7, 2004

How can I repair the database (5 gb) and remove the transaction log (45 gb). Whenever I run the maintanence wizard, it corrupts the db and I have to restore the db. Whenever I try to shrink the transaction log, the query runs but it doesn't shrink it at all. Is there a manual method for either of these and if so, how?

View 1 Replies View Related

How Database Mirroring Can Repair Page Corruptions

Aug 29, 2013

If we restore a database (full backup) first and continuously apply its transnational log backups, do we end up with two identical databases at page level eventually?

If so, page level repair to principle server may work as documented. I can see SAN level mirroring will give you exactly two identical databases at page level eventually at some point of time.

I can see Sybase device (in MS word file) level mirroring will give you two identical things at page level for same device.

But applying the transcriptional logs sequentially on the other servers, can SQL Server guarantee these two databases are identical at page level given there is server configuration can be different?

View 1 Replies View Related

SQL Tools :: How To Repair Backup Of MDF File Database

Jun 30, 2014

One of our clients gets the following error when trying to backup a database:

View 6 Replies View Related

SQL Tools :: Repair Database Without Being Attached (2005)

May 17, 2015

Is it possible to try repair a database without being attached, giving the path to the files?

I'm trying to attach a database that i recover from a disk, and i'm not able to attach, gives me an error, saying i should do a db check.

View 3 Replies View Related

Repair Northwind Database In SQL Server Management Studio Express

May 7, 2007

Hi all,

Long time ago, I downloaded the Northwind and pubs databases from the Microsoft website (I do not remember the details of it) and installed these two databases together into the SQL Server Management Studio Express of my PC (Microsoft Windows XP Pro). I tried to learn an example of using "User Instance" (source code was from a book) on the Northwind database located in my SQL Server Management Studio Express. I just find out that my Northwind database has the title only and no tables at all. If I click on the "+" in front of the "Northwind", I got the following error message:

Microsoft SQL Server Management Studio Express



Failed to retrieve data for this request.(Microsoft SqlServer.Express.SmoEnum)



Additional information:

One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from backup. (Microsoft SQL Server, Error: 5173)..



Please help and tell me how I can repair this Northwind database in my SQL Server Management Studio Express.



Scott Chang



P. S.



I deleted the name 'Northwind' in my SQL Server Management Studio Express, executed the "SQL2005DBScriptsInstnwind" program and I got the following error message: Msg 1802, Level 16, State 4, Line 1

CREATE DATABASE failed. Some file name listed could not be created. Checked related errors.

Msg 5170, Level 16, state 1, Line 1

Cannot create file 'c:Program FilesMicrosoft SQL ServerMSSQL.1DATAorthwindorthwind.ldf' because it already exist. Change the file path or the file name, and retry the operation.

Msg 15100, Level 16, State 1, Procedure sp_dboption, Line 64

The database 'Northwind' does not exist. Use sp_helpdb to show available database.

Msg 911, Level 16, State 1, Line 1

Could not locate entry in sysdatabases for database 'Northwind'. No entry found with that name. Make sure that name is entered correctly

View 5 Replies View Related

Error 25115 Wrong Page (potential Database Corruption). Try Running The Repair Utility.

May 2, 2008



Hi,

Please Help, I am very desparate for a solution to this one.

I have an error appearing

"Error 25115 Wrong Page (potential database corruption). Try Running the Repair Utility."

I have SQL Server Enterprise set up with Merge replication, it is being used to Sync with Windows Mobile Devices as the subscribers.

All the Windows Mobile subscribers have been synchronising fine up until recently, when 1 of the Subscribing Windows Mobile devices received this error.
The day after, another device Synchronised fine the first time (note that the Synchronisation was a long one and the SDF grew in size dramatically while the synchronisation occured, but the Sync worked fine and the SDF dropped back to its initial size) The 2nd sync 5 mins later failed however so this Mobile device has the same error also.

Any suggestions as to the below are much appreciated

a) Why this error occurs?
b)How do you resolve this error?
c)What is the Repair utility mentioned in the error, and is it of use to me?


Thanks in advance, I am very greatful for any advice.

View 8 Replies View Related

How To Repair A Corrupted OLAP Database? (was Olap!:)

Jun 12, 2007

How to repair a corrupted OLAP database?

View 2 Replies View Related

How I Imported My SQL Database Entities Into My SQL Compact Database

Nov 29, 2006

Hello:

I am still working on my project, but figured I would share my findings with the community, on how I imported my SQL Server database tables into a new SQL Compact Edition database. Unfortunately, I haven't figured a workaround to the IDENTITY_INSERT issue, but other than that, I will proceed.

1) I downloaded and played with the tool presented in the article "Generate SQL Insert statements for your SQL Server 2000 Database" I made the following modifications . (my modification can be found here)
a) Disable scripting dependencies
b) Add a filter for objects to script
c) Prompt for each table from which to export data

2) From the scripts output by this tool, I had to (which I may integrate into the tool later... who knows)
a) Remove 'On Primary' statements after the create table statements.
b) Remove date defaults.
c) Most other SQL generated by the tool seemed to work.

3) Execute each 'Create Table' statement individually.

4) For the Data Import, I had to add semi-colons to the end of each Insert Line.

5) I Have found no workaround for the IDENTITY_INSERT issue. If anyone has a good idea, I would love to hear it. In my case, I was importing the DotNetNuke core store module tables populated with about 2500 products and 20+ categories consisting of a simple categories table and products table. I imported the categories table into a fresh MS Access database file, and then ran the update query against the attached products table in the original SQL Database, then regenerated the insert statements, and imported the data generating fresh product ID's. This database will only be read only, so it didn't matter about maintaining the Product ID's, just the relationship between the products and categories.

Separately, I found a great blog article on how to embed a SQL script as a resource for your application and run it on your applications first run, so my steps above would provide a quick foundation for generating that sql script.

 

View 3 Replies View Related

Database Compact?

Feb 11, 2007

Hi,
I am wondering why a database that was 2Gb in size would come down to just 300Mb when I copy all the data from the origional database into a blank new one.
I ran a database shrink on the origional database but that only reduced it from 2.1 Gb to 2Gb.
I was shocked to see the size difference when I copied the data.
As far as I can tell the copied database still contains all the records of the origional.

I remember that MSAccess had a Compact function that literally copied all the data from one databse into a new empty one - is there the equivalent for SQL?

Any thoughts?

Thanks

View 8 Replies View Related

Compact Database

Jul 20, 2005

Is there a stored procedure that allow the compact database programmaticallyin SQL Server?

View 2 Replies View Related

Compact.database

Nov 20, 2007

Here's the Active X Script I'm trying to migrate into an SSIS task:


Function Main()
Dim Engine, dbPath

dbPath = "c:path..."
Set Engine = CreateObject("JRO.JetEngine")

Main = DTSTaskExecResult_Success
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath &

"database_UnCompress.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath &

"testdatabase.mdb"
End Function


I have problems in migrating. Here are the questions:
1. Is the ShrinkDatabase task the SSIS equivalent of this script? If so, I'm having problems creating a new connection since it is an mdb file stored on local computer and not on a server. Is there a workaround on this?
2. If I have to use the script task, I use this codes:

Set Engine = CreateObject("DAO.DBEngine.35")
Engine.CompactDatabase "C:.path...database_UnCompress.mdb", "C:path... estdatabase.mdb"
or

Set Engine = CreateObject("JRO.JetEngine")
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pathdatabase.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pathcompacted_database.mdb"
Both produce the same error: Option Strict On disallows late binding. Any suggestions?

3. I also tried to use the Execute SQL Task, using dbcc shrinkdatabase. But I seem lost again in creating a connection. Should I consider "database_UnCompress.mdb" as flat file source?

Any help deeply appreciated. Thanks.

View 9 Replies View Related

Access To A SQL Compact Database With ADO

Sep 28, 2007

I want to access to a SQL Compact database with an application develope with Visual Basic ans using ADO (not ADO .Net). Is it possible and how ?
Thank You.

View 1 Replies View Related

SQL Server Compact Database..

Jan 4, 2008

Hi,

I am new to SQL Mobile developement and trying to developing a small device appliction. My C# code is shown below. My code is executing correctly, but i am not able to see the inserted records in to my SQL Compact database. What i am doing here? Please help.

FYI, I have added the database in to my solution. My solution and database resides in E:\some directory, where as the my assembly code base represents the datasource as \ProgramFilesMobExpTrackerMobExpTracker.sdf.


SqlCeConnection connection

{

get

{

if (_connection == null)

{

_connection = new SqlCeConnection(ConnectionString);

_connection.Open();

}

return _connection;

}

}

string CurrentFolder

{

get {return Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);

}

}

const string databaseLocalFileName = "Northwind.sdf";

string DatabasePathName

{

get { return Path.Combine(CurrentFolder, databaseLocalFileName); }

}

const string BaseConnectionString = "Data Source=";

string ConnectionString

{

get { return BaseConnectionString + DatabasePathName; }

}


const string sql =

"INSERT INTO mobexptracker(ExpenseDt,ExpenseDescr,ExpenseAmt) VALUES (@ExpenseDt,@ExpenseDescr,@ExpenseAmt)";

const string sql1 =

"SELECT COUNT(1) FROM mobexptracker";



private void btnSave_Click(object sender, EventArgs e)

{

bool savesucess = Save();

if (savesucess)

{

MessageBox.Show("Expense Saved Sucessfully!");

}

else

{

MessageBox.Show("Error!");

}

}


bool Save ()

{

bool success= false;

using (SqlCeCommand cmd = new SqlCeCommand(sql,connection))

{

cmd.Parameters.Add("@ExpenseDt", txtDate.Text);

cmd.Parameters.Add("@ExpenseDescr",txtExpDesc.Text);

cmd.Parameters.Add("@ExpenseAmt",txtExpAmount.Text );

int cnt = (int)cmd.ExecuteNonQuery(); // ExecuteScalar();

cmd.

success = cnt > 0;

}



return success;

}



View 7 Replies View Related

Compact Sqlce Database

Apr 26, 2007

Hi, there;

I got a SqlCe2.0 database here called JOB.sdf, size is 260K. When I tried to compact it, it took very long and that JOB.sdf.tmp was created with 27.7M!!!, I can still open table in the database, but I found that there is some invalid data (unreadable square boxes). It looks like database was corrupted. My application gave error:

Error Code: 80040E14
Message : The OLE DB Execute method failed. The SQL statement is not valid. [,,,SQL statement,,]
Minor Err.: 28560
Source : Microsoft SQL Server 2000 Windows CE Edition
Error Code: 80040E14
Message : Line 1: Incorrect syntax near 'à Ã§¼‚¬Ã©€™€°Ã¬±´ÃªÅ ®Ã£¶»Ã¤¡Æ’ꢀ¹Ã¨Å¸¬Ã£³Å¡'.
Minor Err.: 170
Source : Microsoft OLE DB Provider for SQL Server
Error Code: 80040E14
Message : Unclosed quotation mark before the character string 'à Ã§¼‚¬Ã©€™€°Ã¬±´ÃªÅ ®Ã£¶»Ã¤¡Æ’ꢀ¹Ã¨Å¸¬Ã£³Å¡'.
Minor Err.: 105
Source : Microsoft OLE DB Provider for SQL Server</E>



Note: " " is displayed as "SOHSOH....." with black background.



Apart from compacting database, is there manual job or tool we can do/use to fix a corrupted database caused by power failure? (e.x: all data saved successfully before power failure)?



Thanks

View 6 Replies View Related

Compact Sql Mobile 3.0 DataBase In C++/OLE DB ?

Jan 2, 2006

Hello,

I'm porting my C++ (EVC3) application from Sql CE 2.0 to Sql Mobile 3.0
(with OLE DB). To compact a 2.0 database, i used ISSCECompact interface.
But it doesn't exists with the new version. I've only found C#
and VB.Net samples in MSDN ...

Thanks in advance.

View 8 Replies View Related

Zero Out SQL Server Compact 3.5 Database

Feb 22, 2008



I have an application that uses a SQL Server Compact 3.5 database backend. Everytime the application starts I want to zero out my database, meaning remove all records and reseed all identities. This datatbase is then filled based on a directory structure. Once this DB is filled I then send the entire database to a Windows Mobile PPC device via 802.11g WIFI. Before sending the database I first create an MD5 checksum on both the server and client sides to see if the database actually needs to be transfered. If the checksums match I will not send it as the client already has the lastest copy.

My problem is that I can never count on the database identity values starting at the same number on any particular instance of the application so the checksums are usually different. To solve this problem I need to ensure that everytime I start my server application the database (and all identifiers) will always be the same, will always be as if I just creaed it. How do I do this?!?!?!? This seems like it would be a trivial operation as I can imagine its use in multiple situations. Anyone know how to zero out the database?

View 1 Replies View Related

How To Connect To Compact Edition Database

Dec 18, 2007

I need to create a desktop program on vb.net , based SQL compact edition. but I do not know how to connect to CE database. I already create the sdf file, but I can not connect it from the poject , is there any way to do it ?

View 1 Replies View Related

Compact Database Error Code: 0

Jan 9, 2006

I am currently working in VB.NET with SQL Mobile 2005.  I am trying to compact a database, .sdf, using the SqlCeEngine Object compact(connectionstring).  When I use this code to compact a small database, only about 300KB, it returns okay however when I try to compact a larger database, about 9MB, it returns with a SQL Error Code: 0, "The operation completed successfully" however with no compacted database.  The code works however it only seems to work for smaller databases.  Does anyone have any ideas on how to correct this error or tell me why it returns with that type of error.

Snuggs

View 8 Replies View Related

SQL Server 2005 Express - Compact Database ?

Mar 3, 2007

Every time I modify my SQL Server database, it grows by about 1 MB.  I haven't added any data, in fact have reduced column sizes. Is there a utility that will compact the database and return it to a more manageable size? 

View 2 Replies View Related

Creating Database Diagrams With SQL Compact 3.5 And VS2008 RTM

Nov 30, 2007

I'm using VS2008 RTM with a new SQL Compact 3.5 database and I read in VS2008 and SQL Compact 3.5 BOL that Database Diagrams are supported as well as Foreign Key creation from Server Explorer.

However, there doesn't seem to be support for this. Database Diagram commands are not displayed for this new database (but it is for my SQL Express database) as instructed by BOL.

Can anyone tell me if VS2008 fully supports SQL Compact 3.5 with database diagrams and visual tools to create relationships? If so, how can you create a database diagram in VS2008 for SQL Compact 3.5?

View 1 Replies View Related

Designing A Compact Database For Mobile Device

Apr 4, 2008

Hey guys,

So I started an SQL CE database for use inside a mobile application. I used SSMS to create a .sdf file (because if I let Visual Studio do it, SSMS can't open it because it will be version 3.5).

The reason I wanted to use SSMS is because I wanted to be able to design the database in design view, and populate it with initial information for the application to use. That means adding tables and rows.

The problem is, SSMS doesn't seem to have a design view available when working with CE databases. It also doesn't seem to have a feature for adding rows into tables. It's essentially as useless as VS2008 for designing my mobile database. It only lets me add tables, and I can't even do that visually in design view. I have to use those cumbersome forms.

Is there any way to design a CE database in design view? And add rows of data into tables? It feels like I'm overlooking something.

Note: I dont need to subscribe or publish the database. The mobile application just needs to use the database as a repository.

View 7 Replies View Related

Compact Edition Database In Object Store On Windows CE 4.2

Oct 10, 2007

The device I'm working on has a filesystem on compact flash, but we're concerned about burning it up with excessive writes. One solution might be to keep the SQL database in the the object store, perhaps dumping a copy out to the CF as backup. Any pointers as to how to accomplish this? If we were to keep the db in a file on the CF, what's the SQL Server CE behavior for writing to the file? Does it write every time a record is created/updated, or is there any ability to control when the data is flushed to the file?

Thanks from an SQL newbie.

View 2 Replies View Related

Compact Server Database-file Not Enabled For Replication

Apr 23, 2008

When I try to create a subscription to my SQL Server Compact 3.5-database file, it gives an SqlCeException-message that says that the file is not enabled for replication. How do enable it?

My SQL Server Management Studio won´t connect to my compact server file right now, so that method is not an option for me right now.

View 1 Replies View Related

SQL SERVER 2005 COMPACT EDITION RC1 - Where To Find Editor For .SDF Database?

Dec 11, 2006

We have a plan to use Microsoft SQL Server 2005 Compact Edition RC1 as a backend. Our Front-end is VS .NET (VB.NET).

We want to know how to edit the Compact Edition database (.SDF). Is there any editor is available right now in the market? or microsoft provided any editor for this.

OR Can i use microsoft 2005 sql server standard edition for this.



Thanks

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved