Showing posts with label basic. Show all posts
Showing posts with label basic. Show all posts

Thursday, March 22, 2012

a visual basic script to DTS

Hello I am trying to convert a VB script someone wrote for my company into a DTS package that will fire automatically whenever the file is updated on the server. I am using vb.net for the firing of the DTS package, but I am having trouble writting the DTS package itself. This is what the code looks like now

If fso.FileExists(cSource) Then
With cne
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & cSource & ";" _
& "Extended Properties=Excel 8.0"
.Open
cSQL = "SELECT * FROM " & sSheet
Set rse = .Execute(cSQL)
End With

While Not rse.EOF
i = i + 1
Me.Label1.Caption = "Updating Sold: " & i
Me.Refresh
If Not IsNull(rse("VEHICLE-STOCK-NO###")) Then
sSearch = "'" & rse("VEHICLE-STOCK-NO###") & "'"
cSQL = "UPDATE Inventory SET SoldDate = '" & rse("FNLZ-DT") & "', "
cSQL = cSQL & "LastUpdate = '" & Now & "' WHERE StockNo = " & sSearch
cSQL = cSQL & " AND SoldDate IS NULL"
cn.Execute (cSQL)
End If
rse.MoveNext
Wend
rse.Close
cne.Close
End If


So basically I have an excel file that is downloaded once a week and then I run this program, well I am having some toubles with making it a DTS

I need to convert this into an active X transfermation code I think
If Not IsNull(rse("VEHICLE-STOCK-NO###")) Then
sSearch = "'" & rse("VEHICLE-STOCK-NO###") & "'"
cSQL = "UPDATE Inventory SET SoldDate = '" & rse("FNLZ-DT") & "', "
cSQL = cSQL & "LastUpdate = '" & Now & "' WHERE StockNo = " & sSearch
cSQL = cSQL & " AND SoldDate IS NULL"
end if

Thanks a lot

DamianSearch SQLDTS (http://www.sqldts.com) website for code examples and more information.

HTHsql

A very basic Q

This is probably a very silly question.I started learning ASP.net by following ASP.NET Unleashed. I am stuck where he wants me to open a connection to SQL Server database. I have just downloaded
MSDE. But I dont know where to type this code and how to run it..so as to connect to the database.

<%@. Import Namespace="System.Data.SqlClient" %
<Script Runat="Server"
Sub Page_Load
Dim conPubs As SqlConnection

conPubs = New SqlConnection( "server=localhost;uid=webuser;pwd=secret;database=pubs" )
conPubs.Open()
End Sub

</Script>


Connection Opened!

Now do i have to change the uid to SA ? (i had to assign one when i downloaded and installed MSDE?

Thanks for the help.when you installed your instance of msde- did you use the username SA or did you use the username webuser?

if you used the username webuser- then you have done just fine...

Thursday, February 16, 2012

A newbie question

Hi all,

I am an experienced developer but a TOTAL newbie when it comes to databases. I am creating a new Visual Basic app for which I need a database and I'm using SQL Server Express with VS 2005.

The problem I'm having is that even after perusing this forum and a lot of MSDN articles, I don't understand something basic... how do I create a database and modify the tables and columns of it (the schema, I mean) while I'm developing this application, without losing all the data every time I make a change?

To clarify, I don't know the entire schema of the database yet; I'm still working it out. I want to develop some forms that display data from some of the tables that I do have, but it seems that no matter what I do, my app wants to connect to the .mdf file in the \bin\debug folder of my project, instead of the one in the project folder itself. So it seems like I have two choices:

1) I leave "Copy to Output Directory" set to "Copy always" which means the .mdf will have the updated schema, but I lose all the data I put in the database every time I run the app, which is no good.

2) I change "Copy to Output Directory" to "Do not copy" which means my data will be preserved but when I change the table schema the database in the \bin\debug folder will still have the old schema.

So what is the correct approach here? Am I supposed to use option #1 above, and then, before exiting the application I write all my data into a separate file that I can read back into the database the next time I run the app (since the old data gets nuked by the "Copy Always" option)? Or is there some way to work directly on the schema of the database with the saved data in it?

The other thing I don't understand is why does VB always look for the db in the \bin\debug folder? How are you supposed to connect to an existing database that lives somewhere else on your drives? When I first created the connection (under "Data Connections" in the Server Explorer) I got a popup window that asked if I wanted to copy the database over, so I said no. So why wouldn't it connect to the original db at the path I specified? Why is still looking for \bin\debug\mydb.mdf?

Sorry for such basic questions, but I'm really confused.

Thanks!

Phil

hi Phil,

first and always, [IMVHO]

pwinant wrote:

The problem I'm having is that even after perusing this forum and a lot of MSDN articles, I don't understand something basic... how do I create a database and modify the tables and columns of it (the schema, I mean) while I'm developing this application, without losing all the data every time I make a change?

To clarify, I don't know the entire schema of the database yet;

bad sentence, this one... this mean no design has been actually implemented... just a brute force "write through" approach...

ok.. that can be an experience as well.. and you see some of the effects when using User Instances feature ... personally I do not use that paradigm so this trouble is not included in my day to day problems list

I'm still working it out. I want to develop some forms that display data from some of the tables that I do have, but it seems that no matter what I do, my app wants to connect to the .mdf file in the \bin\debug folder of my project, instead of the one in the project folder itself. So it seems like I have two choices:

1) I leave "Copy to Output Directory" set to "Copy always" which means the .mdf will have the updated schema, but I lose all the data I put in the database every time I run the app, which is no good.

2) I change "Copy to Output Directory" to "Do not copy" which means my data will be preserved but when I change the table schema the database in the \bin\debug folder will still have the old schema.

So what is the correct approach here? Am I supposed to use option #1 above, and then, before exiting the application I write all my data into a separate file that I can read back into the database the next time I run the app (since the old data gets nuked by the "Copy Always" option)? Or is there some way to work directly on the schema of the database with the saved data in it?

what if you copy back your actual mdf + ldf files in the project folder when you are finished executing/debugging the app, so that you can continue modifying it at design time and maintain the inserted data?

The other thing I don't understand is why does VB always look for the db in the \bin\debug folder? How are you supposed to connect to an existing database that lives somewhere else on your drives? When I first created the connection (under "Data Connections" in the Server Explorer) I got a popup window that asked if I wanted to copy the database over, so I said no. So why wouldn't it connect to the original db at the path I specified? Why is still looking for \bin\debug\mydb.mdf?

my answer is, again, not to use User Instance feature and connect to a "traditional" instance of SQL Server/SQLExpress providing traditional connection parameters... you connect that way to the instance present in your (usually) \Program Files\Microsoft SQL Server\MSSQL.x folder, and it's database are usually in the \MSSQL\Data subfolder...

so you provide InstaceName, InitialCatalog, and authentication info (trusted or standard SQL Server login's credentials) parameters like

connectionString = "Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"
or
connectionString = "Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;"

but, if you use an Express edition of Visual Studio, you loose the possibility to use the integrated designers as they only work with User Instances implementations..

you can code (manually code) your app to connect to "standard" SQL Server\SQLExpress editions, but not via the designers...

[/IMVHO]

regards

|||

Hi Phil,

I am not the most experienced guy in this forum but I believe I can make a suggestion. I believe you are updating your DB schema in VS IDE. I suggest you use of SQL Management Studio Express (It's a free download from Microsoft). In object explorer window of SQL MSE you can right click on databases node and select attach option. This will allow you to select an mdf file from somewhere on your computer and attach it to your DB. I hope it helps.

FlatWhite

|||

Hi Phil,

Check out my last post in this thread. In the post I discuss user instances and how they work and point to a white paper that explains them in more detail. The behavior you're seeing is the result of how VS works with files and is by design. When you include your database as part of your project, it gets moved around just like any project file; when you are debuging (F5) you are actually running your application from the .\bin\debug directly, not from your project directory, which is why you see this behavior. This behavior is required for ClickOnce to work, but is targeted as single user applications. If you're creating a multi-user application you shouldn't be using user instances, you should put your database on a central server and connect to it through tat.

There is no one right way to deal with the whole "lost data" issue caused by the VS behavior related to embedded databases. I've described a couple ways, here and here and MF mentions a variation in the post I've already linked to above. There are others as well, it's all about how you want to deploy your database.

Mike

|||

Hi all,

I've received three emails now saying that different people have replied to my post, but when I click on the link in the email it says there's no such post, and I don't see anything here in the forum except my original post. Not sure why that's happening (I hope this post will show up!). Anyway, thanks to all those who are trying to answer my question. :-) Hopefully your posts will actually show up for me at some point so I can read your entire message!

Phil

Edit: ok, now that I've replied I can see the other posts! Yay!

|||

hi Phil,

actually I do not see your last post as well ... does this one shows up?

let's see..

Monday, February 13, 2012

A mindboggingly basic question

I'm very new to being an SQL DBA (I'm an MS Access and Cold Fusion
developer), and I've been tossed in the deep with a grant project
where we're going to be pushing out data in XML format. So I'm trying
to bring myself up to speed on, well, how to do this. I've been going
through an online XML tutorial (http://www.w3schools.com/xml/) and I
think I get the basic idea of XML and schemas.
I've lately been trying to apply what I learned there to get XML
output from SQL. I started with the code snippet in the SQL Books
Online for the Northwind Db. I created a stored procedure with this in
it:
SELECT Customers.CustomerID, ContactName, CompanyName,
Orders.CustomerID, OrderDate
FROM Customers, Orders
WHERE Customers.CustomerID = Orders.CustomerID
AND (Customers.CustomerID = N'ALFKI'
OR Customers.CustomerID = N'XYZAA')
ORDER BY Customers.CustomerID
FOR XML AUTO
GO
This is what it outputs in the query analyzer:
<Customers CustomerID="ALFKI" ContactName="Maria Anders"
CompanyName="Alfreds Futterkiste"><Orders CustomerID="ALFKI"
OrderDate="1997-08-25T00:00:00"/><Orders CustomerID="ALFKI"
OrderDate="1997-10-03T00:00:00"/><Orders CustomerID="ALFKI"
OrderDate="1997-10
I'm assuming that it's being truncated because of something to do with
the query analyzer.
So I tried linking to the SP via an Access DB, and outputting it into
a text format (well, I've tried a couple of different things). When I
try the text format, this is what I get:
| XML_F52E2B61-18A1- |
| <Customers |
I just must be missing something about how I can get the information
the SP retrieves into a plain file that can be used as XML. I know
this is really basic programming stuff, but I seem to be hitting a
wall in my head somewhere in how I'm thinking about this.
So what I'm looking for is an idea of what to use on the front end to
get the SP I have into a file that can be pushed around places. Access
doesn't seem to have what I'm looking for (or maybe I'm just not
looking at the right commands). This is the Access code I'm using to
create the files in question:
DoCmd.OutputTo acOutputQuery, "qryXMLOrdersAndCustomers", txt,
"C:\CFusionMX\wwwroot\TestingXMLStuff\xmlfromnorth wind.xml"
I know this is a longwinded post, and I know that this is a really
basic question, but if someone could help point me in the right
direction, I'd really appreciate it.
Siobhan Perricone
Systems Developer
Vermont Agency of Natural Resources
(my comments are my own, not my employer's)
You are correct, there are limitations with Query Analyzer regarding column
size which causes the result set to be truncated. Go to
TOOLS/OPTIONS/RESULTS and set the "Maximum characters per column:" to 8192.
That is the max allowed in QA.
To get the results into a file go to QUERY and select "Results to File".
If you get results greater than 8192 chars, you might need to edit the file
to get rid of unneccesary line breaks that occur at 8192 intervals. However,
this size should allow you to run most test queries.
"Siobhan Perricone" <siobhan.perricone@.nostatespam.vt.us> wrote in message
news:j552g0pefgfmvtchbb6tes9ah0vp61cgbo@.4ax.com...
> I'm very new to being an SQL DBA (I'm an MS Access and Cold Fusion
> developer), and I've been tossed in the deep with a grant project
> where we're going to be pushing out data in XML format. So I'm trying
> to bring myself up to speed on, well, how to do this. I've been going
> through an online XML tutorial (http://www.w3schools.com/xml/) and I
> think I get the basic idea of XML and schemas.
> I've lately been trying to apply what I learned there to get XML
> output from SQL. I started with the code snippet in the SQL Books
> Online for the Northwind Db. I created a stored procedure with this in
> it:
> SELECT Customers.CustomerID, ContactName, CompanyName,
> Orders.CustomerID, OrderDate
> FROM Customers, Orders
> WHERE Customers.CustomerID = Orders.CustomerID
> AND (Customers.CustomerID = N'ALFKI'
> OR Customers.CustomerID = N'XYZAA')
> ORDER BY Customers.CustomerID
> FOR XML AUTO
> GO
> This is what it outputs in the query analyzer:
> <Customers CustomerID="ALFKI" ContactName="Maria Anders"
> CompanyName="Alfreds Futterkiste"><Orders CustomerID="ALFKI"
> OrderDate="1997-08-25T00:00:00"/><Orders CustomerID="ALFKI"
> OrderDate="1997-10-03T00:00:00"/><Orders CustomerID="ALFKI"
> OrderDate="1997-10
> I'm assuming that it's being truncated because of something to do with
> the query analyzer.
> So I tried linking to the SP via an Access DB, and outputting it into
> a text format (well, I've tried a couple of different things). When I
> try the text format, this is what I get:
> --
> | XML_F52E2B61-18A1- |
> --
> | <Customers |
> --
> I just must be missing something about how I can get the information
> the SP retrieves into a plain file that can be used as XML. I know
> this is really basic programming stuff, but I seem to be hitting a
> wall in my head somewhere in how I'm thinking about this.
> So what I'm looking for is an idea of what to use on the front end to
> get the SP I have into a file that can be pushed around places. Access
> doesn't seem to have what I'm looking for (or maybe I'm just not
> looking at the right commands). This is the Access code I'm using to
> create the files in question:
> DoCmd.OutputTo acOutputQuery, "qryXMLOrdersAndCustomers", txt,
> "C:\CFusionMX\wwwroot\TestingXMLStuff\xmlfromnorth wind.xml"
> I know this is a longwinded post, and I know that this is a really
> basic question, but if someone could help point me in the right
> direction, I'd really appreciate it.
> --
> Siobhan Perricone
> Systems Developer
> Vermont Agency of Natural Resources
> (my comments are my own, not my employer's)
|||On Fri, 23 Jul 2004 11:26:08 -0400, "John Kotuby" <jkotuby@.snet.net>
wrote:

>You are correct, there are limitations with Query Analyzer regarding column
>size which causes the result set to be truncated. Go to
>TOOLS/OPTIONS/RESULTS and set the "Maximum characters per column:" to 8192.
>That is the max allowed in QA.
Ok, I've done that. Thanks!

>To get the results into a file go to QUERY and select "Results to File".
>If you get results greater than 8192 chars, you might need to edit the file
>to get rid of unneccesary line breaks that occur at 8192 intervals. However,
>this size should allow you to run most test queries.
What I'm really asking is what do I use to be able to make a file on a
regular basis. I mean, I'm not going to go into query analyzer and
pull this data every day. I was afraid that my question was so low
level that people would think I couldn't possibly be really asking
what I am.
Say you have a pile of data in SQL that you want to shove out into an
XML file that you can then ship off to someone. How do you do that? (I
guess that's how basic a question I'm asking here) I just seem to be
missing something in the documents and books I'm reading. They are all
assuming a level of expertise or experience I just don't have. Maybe
I'm skimming too much.

>"Siobhan Perricone" <siobhan.perricone@.nostatespam.vt.us> wrote in message
>news:j552g0pefgfmvtchbb6tes9ah0vp61cgbo@.4ax.com.. .
>
Siobhan Perricone
Systems Developer
Vermont Agency of Natural Resources
(my comments are my own, not my employer's)
|||Siobhan,
Not sure what you're VB is like but assuming you can read it then the
following would save the results of a stored procedure 'SQL_First' to a
result file
Sub SaveXml()
Dim oCmd As Command
Dim oPrm As Parameter
Dim oDom As IXMLDOMDocument2
Set oDom = New DOMDocument40
Set oCmd = New Command
oCmd.ActiveConnection = "Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=Northwind;Data
Source=."
oCmd.CommandText = "SQL_First"
oCmd.CommandType = adCmdStoredProc
oCmd.Properties("Output Stream") = oDom
oCmd.Execute , , 1024
oDom.Save "c:\temp\results.xml"
End Sub
{The project would need to reference ADO and msxml4.dll )
Hope that helps some
Graham
"Siobhan Perricone" <siobhan.perricone@.nostatespam.vt.us> wrote in message
news:41m2g0djdtibvtqmpoave9oa7il74vgdae@.4ax.com... [vbcol=seagreen]
> On Fri, 23 Jul 2004 11:26:08 -0400, "John Kotuby" <jkotuby@.snet.net>
> wrote:
column[vbcol=seagreen]
8192.[vbcol=seagreen]
> Ok, I've done that. Thanks!
file[vbcol=seagreen]
However,[vbcol=seagreen]
> What I'm really asking is what do I use to be able to make a file on a
> regular basis. I mean, I'm not going to go into query analyzer and
> pull this data every day. I was afraid that my question was so low
> level that people would think I couldn't possibly be really asking
> what I am.
> Say you have a pile of data in SQL that you want to shove out into an
> XML file that you can then ship off to someone. How do you do that? (I
> guess that's how basic a question I'm asking here) I just seem to be
> missing something in the documents and books I'm reading. They are all
> assuming a level of expertise or experience I just don't have. Maybe
> I'm skimming too much.
>
message
>
> --
> Siobhan Perricone
> Systems Developer
> Vermont Agency of Natural Resources
> (my comments are my own, not my employer's)
|||On Sun, 25 Jul 2004 19:26:39 GMT, "Graham Shaw" <Graham@.somewhere.com>
wrote:
Hi Graham,
Thanks so much for responding.

>Not sure what you're VB is like but assuming you can read it then the
>following would save the results of a stored procedure 'SQL_First' to a
>result file
I'm not great. I came into Db programming from being a super user,
rather than coming at it from actual training in languages. So I'm
trying to work my way through what you've so kindly provided. I'm not
sure I understand everything you've put in here, but I'm able to grok
a fair amount from context.

>Sub SaveXml()
>Dim oCmd As Command
>Dim oPrm As Parameter
>Dim oDom As IXMLDOMDocument2
When I compile this, it pops up an "User-defined type not defined"
error at the last line of this block. I've never done a "user-defined
type" before. Is this something I should set up somewhere?
Or would this part of your post:

>{The project would need to reference ADO and msxml4.dll )
Be the explanation for that? If so, I'm not sure what to do with that
information.
One thing I'm wondering now, is there a command I can put at the end
of my stored procedure in SQL that'll just run it and pop it out to a
file? I have been trying to find such, but I suspect I'm not looking
for the right syntax in books online.
I don't think I really have to have this in an MS Access Db...
*ponder*
Siobhan Perricone
Systems Developer
Vermont Agency of Natural Resources
(my comments are my own, not my employer's)
|||Hi Siobhan
Yes the unknown type is the bit about referencing in VB goto
Project/References on the menu and scroll down to Microsoft XML, v4.0 (if
you only have v3.0 then select that but change the Set oDom = New
DOMDocument40 to Set oDom = New DOMDocument30. For the ADO follow the same
procedure and select "Microsoft ActiveX Data Objects 2.X Library" where X is
prefereably 6 or above although 5 will work with what I gave you.
Another alternative would be to look in BOL for the command line version of
the query analyser iql that can output its results to a file.
G
"Siobhan Perricone" <siobhan.perricone@.nostatespam.vt.us> wrote in message
news:f5cag05sstqbuam2cggtbermgu0urqq8gs@.4ax.com...
> On Sun, 25 Jul 2004 19:26:39 GMT, "Graham Shaw" <Graham@.somewhere.com>
> wrote:
> Hi Graham,
> Thanks so much for responding.
>
> I'm not great. I came into Db programming from being a super user,
> rather than coming at it from actual training in languages. So I'm
> trying to work my way through what you've so kindly provided. I'm not
> sure I understand everything you've put in here, but I'm able to grok
> a fair amount from context.
>
> When I compile this, it pops up an "User-defined type not defined"
> error at the last line of this block. I've never done a "user-defined
> type" before. Is this something I should set up somewhere?
> Or would this part of your post:
>
> Be the explanation for that? If so, I'm not sure what to do with that
> information.
> One thing I'm wondering now, is there a command I can put at the end
> of my stored procedure in SQL that'll just run it and pop it out to a
> file? I have been trying to find such, but I suspect I'm not looking
> for the right syntax in books online.
> I don't think I really have to have this in an MS Access Db...
> *ponder*
> --
> Siobhan Perricone
> Systems Developer
> Vermont Agency of Natural Resources
> (my comments are my own, not my employer's)
|||Sorry iql should be isql
"Graham Shaw" <Graham@.somewhere.com> wrote in message
news:3qbNc.663$C85.648@.newsfe1-gui.ntli.net...
> Hi Siobhan
> Yes the unknown type is the bit about referencing in VB goto
> Project/References on the menu and scroll down to Microsoft XML, v4.0 (if
> you only have v3.0 then select that but change the Set oDom = New
> DOMDocument40 to Set oDom = New DOMDocument30. For the ADO follow the same
> procedure and select "Microsoft ActiveX Data Objects 2.X Library" where X
is
> prefereably 6 or above although 5 will work with what I gave you.
> Another alternative would be to look in BOL for the command line version
of
> the query analyser iql that can output its results to a file.
> G
> "Siobhan Perricone" <siobhan.perricone@.nostatespam.vt.us> wrote in message
> news:f5cag05sstqbuam2cggtbermgu0urqq8gs@.4ax.com...
>
|||On Mon, 26 Jul 2004 17:44:31 GMT, "Graham Shaw" <Graham@.somewhere.com>
wrote:

>Yes the unknown type is the bit about referencing in VB goto
>Project/References on the menu and scroll down to Microsoft XML, v4.0 (if
>you only have v3.0 then select that but change the Set oDom = New
>DOMDocument40 to Set oDom = New DOMDocument30. For the ADO follow the same
>procedure and select "Microsoft ActiveX Data Objects 2.X Library" where X is
>prefereably 6 or above although 5 will work with what I gave you.
Ok, I have those things set, and it's giving me an error I wouldn't
have expected. It says:
Runtime error '-2147467259 (80004005)':
[DBNETLIB] [ConnectionOpen(Connect()).] SQL Server does not exist or
access denied.
I would have thought that since I'm running this from a Db that has a
connection to the server set up it'd run.
I haven't looked for an explantion of the error yet (clicking help
basically says "automation error" but nothing else). But I'm starting
with looking at the ActiveConnection line. Just posting here in case
you know off the top of your head what might cause this.

>Another alternative would be to look in BOL for the command line version of
>the query analyser iql that can output its results to a file.
I've tried looking for this, but I'm embarassed to say that I'm not
certain how to use it. BOL is great about giving details on command
syntax, but not great on methods of applying the commands. *sigh* I
know, I need a class...

>"Siobhan Perricone" <siobhan.perricone@.nostatespam.vt.us> wrote in message
>news:f5cag05sstqbuam2cggtbermgu0urqq8gs@.4ax.com.. .
>
Siobhan Perricone
Systems Developer
Vermont Agency of Natural Resources
(my comments are my own, not my employer's)
|||Hi Siobhan
If you already have a connection object open then just do
set oCmd.ActiveConnection=YourConnectionObjectName
instead of the connection string
as for isql just go into BOL click on the search tab and type 'isql utility'
in the text box and hit "list topics", it should come up ranked about number
9 ;o)
Graham
"Siobhan Perricone" <siobhan.perricone@.nostatespam.vt.us> wrote in message
news:asfcg0hebo7pjs29sdnd3n8u19bv541qde@.4ax.com... [vbcol=seagreen]
> On Mon, 26 Jul 2004 17:44:31 GMT, "Graham Shaw" <Graham@.somewhere.com>
> wrote:
same[vbcol=seagreen]
is[vbcol=seagreen]
> Ok, I have those things set, and it's giving me an error I wouldn't
> have expected. It says:
> Runtime error '-2147467259 (80004005)':
> [DBNETLIB] [ConnectionOpen(Connect()).] SQL Server does not exist or
> access denied.
> I would have thought that since I'm running this from a Db that has a
> connection to the server set up it'd run.
> I haven't looked for an explantion of the error yet (clicking help
> basically says "automation error" but nothing else). But I'm starting
> with looking at the ActiveConnection line. Just posting here in case
> you know off the top of your head what might cause this.
of[vbcol=seagreen]
> I've tried looking for this, but I'm embarassed to say that I'm not
> certain how to use it. BOL is great about giving details on command
> syntax, but not great on methods of applying the commands. *sigh* I
> know, I need a class...
message[vbcol=seagreen]
a
>
> --
> Siobhan Perricone
> Systems Developer
> Vermont Agency of Natural Resources
> (my comments are my own, not my employer's)

Saturday, February 11, 2012

A Little Basic Help needed (SQLServer 2005) Merge Replication

Hi all,

We are using SQL Server 2005, on Windows server 2003 R2.

We Have Two Database Servers say DBServer1 and DBServer2, Now I wants to do Replication between these to servers, such that

1. The Changes at DBServer1 should be reflected at DBServer2
2. The Changes at DBServer2 should be reflected at DBServer1
3. Changes includes Data changes and Schema Changes
4. After every Synchronization Both Databases should be Identical

I tried doing so, what i did was
I cofigured Distribution at DBServer1, also Publisher and Publication at DBServer1
and Made a Subscription at DBServer2.

What I successfully done is
If Publisher means DBServer1 do some changes then it gets updated at DBServer2.
But New Rows added at DBServer2 doesn't gets added at DBServer1

Thanks in Advance,
Vishalgiri Goswami
Kalptaru Infosoft Pvt. Ltd.Did you start the merge agent job? The merge agent does the synchronization.|||Yes Sir, Merge Agent is Running, I have Sheduled it to Run at 5 min Interval, I am viewing it's status from View Synchronization Option.

Even My Snapshot Agent is running too.|||Did you define a subset filter clause? And did your subscriber even download the snapshot? The snapshot agent doesn't need to run every 5 minutes.|||DId your subscriber download the schema from the snapshot? Does your publication have filtering, if yes, what does the subset filtering clause look like?