.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Move the database files to different branches before replication?

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :Sql Server

Hi all,


I want to start a replication between 3 sites using Merge replication, 1<sup>st</sup> branch is the distributer and publisher and already has a database, the others are subscribers and they are new (No data yet). But the size of the database in the main branch is about 4 GB. So if I start the replication, 4 GB will be replicated which something I don’t want. Is there a way I can put the database in the other branches manually? So nothing will need to replicate at the first time. And then replication will take place.


Waiting your valuable reply,




View Complete Post

More Related Resource Links

How to attach distribution database files

Hi  i am new to sql server. when i am exploring replication concepts, i did a small mistake i.e. i have deleted distribution database.after that i realised and try to create a new one but it still points to the old database named as "distribution" which is not available. i didnt take the backup of the database before dropping. But i have mdf and ldf files of the distribution database. so can i use the sp_attach method to add the  mdf and ldf files? or any other way to fix this issue? please help me on resolving this issue Thanks, Rock  

Database Table: Move row to the top of the table???

I have a table in my aspnet database.  I added a bottom row "Not Selected", if the user doesn't select from a databound drop down list.  This row is at the bottom, because I just added it to the table data.  Is there any way to move this one row to the top of the table manually?  There is not "cut" and "paste" when I select the whole row.Any idea how to do this?  Thanks in advance. :)

Insert multiple files to SQL Database in VB

My files are being inserted but the byte array is showing as a 0x0000... etc for every file after the first inserted file. The first inserted image is correct. The database is set up as an Image type. The problem exists in the code here. Thank you in advance! Dim uploads As HttpFileCollection uploads = HttpContext.Current.Request.FilesFor i As Integer = 0 To (uploads.Count - 1) If (uploads(i).ContentLength > 0) Then Dim c As String = System.IO.Path.GetFileName(uploads(i).FileName) 'Dim upload As HttpPostedFile = uploads(i) If Not fileUpEx.PostedFile Is Nothing And _ fileUpEx.PostedFile.ContentLength > 0 Then Try If CallingTab >= "" Then Call UploadImage(c, uploads(i).ContentLength, uploads(i).ContentType, uploads(i).InputStream, _ strUsername, intSiteID, intCompanyID, strDocumentType, CallingTab, NewVersionNumber) Else lblStatus.Text = "Document Not successfully uploaded to the database! Problem occured with the Calling Tab" End If Catch Exc As Exception Response.Write("Error: " & Exc.Message) End Try

what is the better design for location of system database data / log files and user data/log file,

is there a guideline for better performance for system database data location log location, like tempdb location etc. also better location for user databases/data and log.

adding sqlserver database files in the time of project deployeement

hi all,        how can i add sql server 2005 database files in the time of a windows application project deployment i have designed a project in Visual Studio 2005 using vb.net language and i want add sql server 2005 database file to it. i am connecting to sql server database by the connection string not using any any dataset or anything else. so how can i add database file ... please replay... 

Multiple Data Files Per Database Not Allocating

We recently read that I/O performance can be increased by creating multiple data files for a database: "As a general guideline, create one data file for each CPU" So went ahead and did this, and restarted the SQL engine, but still it is writing all data to the first file "Production_data_1". We would assume after we restarted it would reallocate the data across all four data files. Currently, the other three data files have 1GB of space allocated, but the engine is not writing data to the other three files. How can we distribute the existing data across all four data files? See a screenshot we took at: http://www.ftoperations.net/screenshot.png

Tx Replication Error when renaming Subscription Database

Tx Replication Errors when renaming Subscription Database. Please help. It seemed to work earlier, but now is giving errors when i rename subscription database.

how to do sharepoint database disk usage analysis and selective replication?



I have a SharePoint 2007 database that is 16GB in size and I want to know why, and how I can reduce the size. Ideally I would like a trimmed replica to use as a developer workstation that retains a good sample data set, and has the ability to be refreshed.

Can you please tell me if there are any third party tools or other methods to accomplish this? I have found the Microsoft tool (stsadm) to be very limited in this regard.

Many thanks.

Move Single MOSS Content Database to Different SQL Server

We want to mmove the single database of MOSS on Network Test and Development to the Production SQL Server. But MOSS aplication server remains same!

So in this condition it points out for the two database servers at the same time.

Is it possible? Or I need to migrate the all concern databases to the another SQL Server?

Pls HelP!

Database snapshots do not work well with databases having multiple log files


It appears there is a bug in the implementation of database snapshots.

If you create a snapshot on a database with multiple log files:

Then restore from the snapshot:

then all of you log files, but one will disappear. As a result the backup command will fail with the following message:
Msg 3636, Level 16, State 2, Line 1
An error occurred while processing 'BackupMetadata' metadata for database id 12 file id 10.
Msg 3046, Level 16, State 2, Line 1
Inconsistent metadata has been encountered. The on

How to verify Master and Replication database are in synch



I have two SQL Server 2005 standard Edition SP2. Where one server act as master database and other as replication database.

I have setup transactional replication between master and replication database. also i have written one stored procedure which check the total number of the records in master and replication database.

Now my requirement is to verify data between two server are in synch.

Let me explain with example:

I have customer table in master database has customerid:100  & customer_City:New York.

User update city to Mumbai

Now I have to verify at one point in time, may be at the end of day that  customer_city of customerid:100 in replication database  updated to Mumbai. In short, both master and replication databases are in synch.

Please let me know your view.


Thanks and Regards





Restore using TSQL, how to determine the files to move/overwrite


There might be an easier way to perform it, if so, please advise.  I am looking for a scriptable solution (preferably TSQL).

I want to code a tsql procedure to restore a database from a backup file (.bak).  The procedure must allow to restore a backup from a database to a different database.

When performing it through the SSMS interface, I see all the files in the .bak file.  From there, I can associate the files in the backup to the appropriate files in my destination database.  when generating TSQL, this translates to MOVE statements for the files.

Can I translate the whole process in TSQL?  In order to know how to map my files, I must first gather the information on which files are present in my bak file.  Can one read the definition of the files contained in a backup file before performing the restore.  Preferably using TSQL?

Move Configuration Database to a different server



When installing Sharepoint, I accidentally selected to install it as a SQLEXPESS server located at ComputerName\Sharepoint and didn't notice. When my site hit the 4 gig limit, I moved the content database to another server quite easily.


Now I'm wondering if it is best practice to make sure that everything is on the same server. Poking around in Central Administration I notice quite a few references to the Sharepoint server, and then my Content Database which is off on it's own. Is there an easy way to migrate everything over to my new server (a cursory glance around google hasn't turned up anything yet) or should I leave it fragmented as it is?




Merge replication with Web synchronization - want to move virtual directory


Configuration: W2003 server, SQL 2008 ent, SQLCE 3.5sp1 (version 3.5.8080.0)

Using merge setup wizard many moons ago I set the path for my virtual directory to a disk that is now having space problems. As you can guess, I took the default path for SQLCE under C:/Progam Files. Occasionally a subscriber has an issue and when they reinitiate a subscription for some reason a file that is twice as large as the database begins to grow under the Web sync folder. This file has an .OUT extension.

I'd like to move the virtual directory to another disk to alleviate the space problems. But with hundreds of active subscriptions I'm leery of doing this since the database size is over 1gb and we do not want to break the current subscriptions!

Can I simply move the virtual directory using a copy/paste of the files and redesignating the path in IIS?

My snapshot folder is fine and I don't need to move that. It's just this IIS virtual directory that is on the C: drive.

I know I cannot create a new Web Sync point using the Wizard since it will break the subsritptions I have out there already.

set up database with .bak files in SAL server management studio



I need to connect to 3 remote databases from my local machine and  restore 3 .bak files, one for each database.

I am new to asp and sql server and am finding SQL Server Management studio quite confusing.  I cannot find any options to connect remotely or restore a database from .bak.

Many thanks

Add Database through App_Data Error- Connections to SQL Server Files (*.mdf) require SQL Express


I am trying to add a new database via the App_Data Folder and I receive an error described below.

I had attached an mdf file to try to use it in SQL Server 2008 Developer and Visual Studio 2010, which was is included in a book's lesson.  Whenever I try to add a database within the App_Data Folder I get an error.

I can create a db by attaching an mdf via SQL Server Mgmt Studio, it connects fine, and I can see tables.

Mgmt Studio- Right Click Databases, Attach, Add, then once mdf is located:

The mdf file location, Database Name, Attach As, -- are all the same:


Do I need to change the Database Name?

Visual Studio- Server Explorer connects fine to mdf OR regular Database, I can see the tables.

However when I attempt to add ANY TYPE OF SQL SERVER DATABASE through the App_Data folder I receive this error "Connections to SQL Server Files (*.mdf) require SQL Server Express 2008 to function properly.  Please verify the installation of the component or download from the URl."

I tested this for both a normal dbo (non mdf) and the mdf.dbo I attached before, with the same error!

Im running XP SP3 w/ Visual Studio 2010 and SQL Server 2008 R2 Developer.  I had previously removed SQL Server Express.

rename SQL 7 database and move to SQL 2005

I need to move an SQL 7 database to an SQL 2005 server that already has a database with the same name. The SQL 7 database needs to have a new name and not affect in any way the one that's already on the 2005.  How can I do this? Do I need to rename the 7 database before I back it up, and if so, how do I do this so everything (log files, etc) reflect the new name so nothing crushes anything on the 2005?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend