.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

Initialize snapshot fro alternate location - multiple .bcp files for an article

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
I have to replicate over 50GB of data over a slow network.  I did not use the option to initialize snapshot from database backup because the replication articles contain row filters.  If I do that, I'll have to run a lot of scripts to remove the data and other unnecessary database objects on the subscriber. Instead, I created a workaround.  On the publisher, I first create the actual push subscription to the target subscriber on the publication.  This subscription is set not to initialize from snapshot.  I then created a second push subscription on the same publication, but the subscriber is a random database on the publisher server.  This second subscription is a dummy subscription set to initialize from snapshot - the purpose is to generate the necessary snapshot files.  I then reinitialized all subscriptions and generate the new snapshot files. On the subscriber, an empty database is created with the same tables as the publisher database.  I created an identical publication on this empty database, and a dummy push subscription on the target subscriber.  The subscription is reinitialized, and the snapshot files on the empty database is created.  These dummy snapshot files are then overwritten with the actual snapshot files created on the publisher, and then I synchronize the the dummy subscriptions with the actual sn

View Complete Post

More Related Resource Links

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa


If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009

Upload multiple files in asp.net

The article Upload multiple files in asp.net was added by habdulrauf on Friday, July 09, 2010.

Some times we need to allow user to upload as many files as he/she wants instead of fixed number of files.So here is the procedure to achieve this. Idea is taken from Joe's video.%@ Page Language="C#" AutoEventWireup="true" CodeFile

how to read config details from multiple config files

Hi, My web application contain 3 config files with different names, ex. firstconfig.config, secondconfig.config, thirdconfig.config.  Each config files have same Key Value pairs. Now what i want to do is, based on the condition i want to read specific info from specific config file. What i tried is, in Web.config files  <appSettings file="firstconfig.config"></appSettings>   In this way i get th info from that particular config file.  Now how do i get details from other 2 config files.   Can any one know abt this.   S. Ramkumar  Smiley

Multiple XML files into SQL SERVER Express 2005

Hello. I am familiar with classic ASP and use this with MS SQL SERVER EXPRESS. I have an SQL table and want to import multiple XML files into this on a daily basis. I currently have 3 files, transferdata.vbs which loops through the XML files. FAQschema.xml which maps XML to the SQL database and test.xml shows the xml in the test file. If I run transferdata.vbs I get the following error "Error opening the data file" line 33 char 3. Microsoft Bulkload for SQL Server". My SQL table is called EnqOrd id (int), Debitor (varchar), PurchaseDate (varchar)     transferdata.vbs set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "Provider=SQLOLEDB; Data Source=XXXXXX\XXXXX; Initial Catalog=XXXX; User ID=XXXXX; Password=XXXXXX" objBL.ErrorLogFile = "E:\fuelsql\Teccom\error.log" ' Here is the path to your XML files Const path = "E:\fuelsql\Teccom\XML\" Dim Text, Title, oFile Dim fso, oFolder, oFiles, wsh ' Object variables Text = "Folder " Title = "XML Files" Set wsh = WScript.CreateObject("WScript.Shell") ' Create FileSystemObject object to access the file system. Set fso = CreateObject("Scripting.FileSystemObject") ' Get Folder object. Set oFolder = fso.GetFolder(wsh.ExpandEnvironmentStrings(path)) ' Get All Files Set oFiles = oFolder.

Import Multiple XML files into Sql Server

Hi, i have nearly 1000 xml files in one folder of similar format and I have xsd for the same as well. I would like to import all the files in to sql table by either looping through all the files or any other way. Thanks

Help! "You must rerun snapshot because current snapshot files are obsolete" every 90 minutes!

I'm having difficulty with SQL Server replication getting machines in the field to replicate correctly.   Here are the specifics of my installation:   100 remote tablet PCs using web sync to update. 1/2 running Vista, 1/2 XP (all latest updates applied) SQL Server Express 2005SP2 w/ cumulative update 6.   Server: Win2003 (all latest updates) SQL Server 2005SP2 CU6   There is 1 database. For each tablet I create a separate publication (PUB001, PUB002, PUB003, etc.) with filtered articles containing data for the tablet. Each publication has a single subscription -- the tablet to which the subscription is assigned. Subscriptions are set to expire after 14 days. Snapshot agent was run when subscription was created, and is set to run automatically every 14 days.     This is a "test" system which is scheduled to roll out into production in 2 weeks.   For the past month I have been running 6 tablets A-OK with no problems (had 6 separate publications/subscriptions on the server/tablets).   I use a stored procedure to create the publications and subscriptions. This stored procedure hasn't changed in months.   Yesterday, we added another 6 tablets w/ separate publications on the server, using the same aforementioned stored procedure.     The tablet application is set to auto-sync over the internet every 15 minutes.   Starting yesterday afternoon, at random, tablets would st

Transactional Publication With Article Using DATE Datatype Causes Snapshot Agent to Fail with Error

So I am using SQL Server 2008 Enterprise Edition (64Bit) and have run into a strange problem that is baffling me. I have two tables that I need to replicate.  They are identical in specification except the name (one is for monthly stats and one daily stats) CREATE TABLE [dbo].[statsDailyLite]( [EntryDate] [date] NOT NULL, [SetID] [int] NOT NULL, [ProductID] [smallint] NOT NULL, [Hooks] [int] NOT NULL, [AdViews] [int] NOT NULL, [Clicks] [int] NOT NULL, [UAdViews] [int] NOT NULL, CONSTRAINT [PK_statsDailyLite] PRIMARY KEY CLUSTERED ( [EntryDate] ASC, [SetID] ASC, [ProductID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ) GO CREATE TABLE [dbo].[statsMonthlyLite]( [EntryMonth] [date] NOT NULL, [SetID] [int] NOT NULL, [ProductID] [smallint] NOT NULL, [Hooks] [int] NOT NULL, [AdViews] [int] NOT NULL, [Clicks] [int] NOT NULL, [UAdViews] [int] NOT NULL, CONSTRAINT [PK_statsMonthlyLite] PRIMARY KEY CLUSTERED ( [EntryMonth] ASC, [SetID] ASC, [ProductID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ) GO They both conatin a thousand or so test rows of data, and they are both in a transactional publication going to another SQL 2008 box. Now when the tables are empty

Import Multiple Text Files

I have 150 data delimited text files that need to be imported to a text file. Each of them is named for the table for which they contain data e.g. address.txt contains data that needs to imported to the address table. So what I have done is create a SSIS package that contains a ForEach loop that iterates through the the files, and has a Load Data field object. What I haven't been able to figure out is what logic needs to be added for the Data Flow. I know I will need a Flat File Source with a connection source that is tied to file it is processing.  However, after all of that I am not sure what do because each text file contains a different table with different columns. Can someone explain to me how to handle this? Thanks, Isaiah 

Receive/Delete Multiple FTP Files based on condition using SCRIPT(VB) TASK

I am trying to receive and delete multiple FTP files from a remote FTP server using Script task Below is the code   Dim FTPConnMgr As ConnectionManager FTPConnMgr = Dts.Connections("FTP Connection Manager") Dim FTPClientConn As FtpClientConnection = New FtpClientConnection(FTPConnMgr.AcquireConnection(Nothing)) Dim FileTimeStampNew As String = "20100913021807" Dim remoteFileNames(0) As String remoteFileNames(0) = Dts.Variables("FtpRemoteDirectory").Value & "*" & FileTimeStampNew & ".*" 'Below hardcoded FileName works good. But the problem is there are lots of file in the FTP folder that I dont want to receive 'remoteFileNames(0) = Dts.Variables("FtpRemoteDirectory").Value & "Company_alpha_Full_20100913021807.xml" Dim localPath As String = Dts.Variables("FtpLocalDirectory").Value FTPClientConn.Connect() FTPClientConn.ReceiveFiles(remoteFileNames, localPath, False, False) FTPClientConn.Close() Dts.TaskResult = ScriptResults.Success End Sub End Class If i specifically mention the RemotefileNames this works fine but, when I say *.* it executes succefully but doesn't receives the file. Please advice how to receive multiple file based on a variable BR, AWM

Upload multiple files to Server

I have an ASPX Page that contains a fileuploader, I want to know how can I upload multiple files together to server and also create a new folder on Server and then upload these files into this new folder! Please send your sample codes in VB.NET,   Thanks,

import multiple Excel 2007 files using openrowset

hello, I Have a folder that includes multiple excle files (ver 2007), i am trying  to loop through each file using vbscript to import its data to sql 2000 using openrowset but i am getting this error in the openrowset line "[Microsoft][ODBC sql server driver] [sql server] [OLE/DB provider returned message: the microsoft office access DB engine cannot open or write to the file '', it is already open exclusively by another user or you need permission to view or write its data] code 80040E14 source microsoft OLEDB provider for ODBC drivers Any help please    

Incorrect hostname in EndPoint location in WSDL for a service with multiple bindings and with multip

We have a WCF web service that is exposed through multiple bindings.  The site is  accessed through multiple IP Addresses/Hostnames (internet/intranet).  Some of the bindings use http transport while others use https transport. The web application is configured to use .NET 4.0 with multipleSiteBindingsEnabled="true" so that we shouldn't have problems with multiple ip addresses/hostnames. What we see is that when the WSDL is accessed using a http based URL (external), the hostnames in the endpoint addresses for http transport based bindings in WSDL are correct (ie, they use the hostname header from the request) while the hostnames in the endpoint addresses for https transport based bindings in the WSDL are incorrect (ie, they do not use the hostname header in the request - they seem to use the hostname from the first available binding in IIS for that scheme and end up with the local machine names/ip addresses in the URL).   We could work around by setting the external hostname/ip in the first binding in IIS for the respective scheme, but then WSDLs accessed from intranet clients would have wrong URLS now. This happens the other way around as well, ie, when the WSDL is accessed using https, the https based addresses are fine, but http addresses in the WSDL are not correct. It looks like hostname header is used only for WSDL endpoint addre

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.

remove upload multiple files link from upload.aspx..

hi, is there a way to remove the upload multiple files link from upload.aspx..without using any custom coding.

Document Set - Problem when uploading multiple files with "Launch forms in a dialog" disabled

Hello, Has anyone come across this before? I have a basic document library for which I have enabled "Allow management of content types" and disabled "Launch forms in a dialog".  Both of these settings are in the "Advanced Settings" page.  Also, the document library does not have versioning enabled and check out is not required. I added the OOTB "Document Set" content type to this document library and allowed OOTB "Document" content type documents in this document set.  This document set does not have any default content. The issue arises after I upload multiple files and click the "Done" button.  After I do this, the browser redirects to the top level of the site!  For example, if I uploaded to my document set at http://server/sites/anyname/doclib, I am redirected to http://server/. This issue has come up in both a standard server and an enterprise server. Steps to repeat issue: Create a document set Open the document set Select "Upload Multiple Documents" Drag and drop or browse for files Click "OK" Click "Done" Actually, this issue also occurs when "Launch forms in a dialog" is enabled.  In this case, you just have to navigate to the upload form directly (with all the necessary query string parameters, of course). Has anyone else seen this issu

Snapshot files obsolete?

I recently had a problem with one of my publications that I haven't been able to figure out.  Hopefully someone can help me with it.    I got this error last week:  You must rerun snapshot because current snapshot files are obsolete.  I assume this means the subscription needed to be re-initialized.  Is this correct?   If so, I don't understand why.   The publication was not changed.  The subscription did not expire.  The subscription was not marked for reinitialization.   Here are the specifics of my installation:   Merge publication with 1 pull subscription. Subscriptions set to expire after 14 days. Merge agent runs every day, every 5 minutes between 12:00:00A & 11:59:59P. Snapshot agent was run once when publication was created and then disabled. Publisher SQL ver: 2000 sp3 Publisher Win ver: 2003 sp1 Subscriber SQL ver: 2000 sp3 Subscriber Win ver: 2003 sp1   The subscription was successfully replicating every 5 minutes.  The data for 12:35 shows the first problem.  Here's the agent history at the time:   runstatus start_time comments error_id 1 5/23/07 12:25 Initializing 0 3 5/23/07 12:25 Connecting to Publisher 'AASTAUSSQL01' 0 3 5/23/07 12:25 Uploaded 4 data changes (3 inserts, 1 updates, 0 deletes, 0 conflicts). 0 3 5/23/07 12:25 Downloaded 7 data changes (2 inserts, 5 updates, 0 deletes, 0 conflicts). 0 2 5/23/07 12:25 Merged 11 data changes (5
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