Sp_addarticle: What's The Difference Between @source_object And @sync_object?
Nov 27, 2005
BOL says:
@source_object - Is the table or stored procedure to be published.
@sync_object - Is the name of the table or view used for producing the data file used to represent the snapshot for this article.
I get how transactional replication is tied to changes in a single table or indexed view (the "source_object"). But what is the role of the sync_object? It appears as if the sync_object can be any simple (non-indexed) view. Hilary Cotter uses it to replicate a calculated field (the number of titles associated with each author) in "Case 4" in this article: http://www.dbazine.com/sql/sql-articles/cotter1.
Does the replication pull data from the sync_object whenever it replicates data, even though BOL says that it is used only for the snapshot data? Am I lacking some fundamental understanding of what the snapshot data is? Isn't it a snapshot of all the data at a particular point in time? If the snapshot contains a calculated field, don't the subsequent replicated transactions pulled from the transaction logs also have to be able to calculate that field?
I have found a bug with the sp_addarticle procedure and have not had any success finding a fix for it. The bug only exists whenever I am adding an article that is vertically partitioned and uses a DTS package to do the processing. In this particular case, I am using snapshot repl. Has anyone experienced this issue before?
Here is the error that gets produced... Server: Msg 156, Level 15, State 1, Procedure syncobj_0x4344414345344530, Line 1 Incorrect syntax near the keyword 'from'.
I was under the impression that once I ran the script, the insert, update and delete command will be generated by SQL Server for me. However, that's not the case. Am I missing anything? How do I add the new article so that the insert, update and delete stored procedure will be autogenerated?
I found the following bug in Management Studio: I add an article with sp_addarticle and a value of 0x00 for @schema_option or via the wizard with all article properties set to false. Then I script the publication to a file. The result contains a sp_addarticle statement with @schema_option = 0x0000000000004071, which must be wrong. To prove that I recreated the article with the generated script and checked the article properties. As I feared 4 of the properties ('Copy clustered index', 'Copy nonclustered index', 'Copy unique key constaints' and 'Convert data types') are set to true!
What is the difference between below? And how can I make GETDATE() the same as System.DateTime.Today.ToShortDateString()? System.DateTime.Today.ToShortDateString() and GETDATE()
Hello, I am transfereing Data into text format. The datas are about 5 table and has almost 50000 to 2 million rows. I am using the same query for BCP and DTS. But I find the dreference between those. I mean DTS is taking less memory and more time than BCP to complete the process . Anybody can share any comment for this issue ?.
hi, i'm having difficulty figuring out how to implement a set difference between two queries. the only set operator i've been able to come across is union. thanks in advance! d
Are SQL Server Express & SQL Server 2005 one & the same thing? Or is the former a part of the latter? Actually when I was downloading Visual Web Developer 2005 Express, I was given the option to download Microsoft SQL Server 2005 Express Edition as well; so I am getting confused between SQL Server Express & SQL Server 2005.
I installed SQL Server 2005 in my WinXP Pro m/c. from the Microsoft website (after re-installing WinXP Pro since XP became corrupt). Earlier I used to login to Management Studio Express using my m/c. name followed by a followed by SQLEXPRESS as the server name. So if my m/c. name is MyPC, then I used to login to Management Studio Express using MyPCSQLEXPRESS as the server name but now when I try to login to Management Studio Express using the above server name i.e. MyPCSQLEXPRESS, then an error gets thrown saying
Cannot connect to MyPCSQLEXPRESS.
Now how do I find out what's the server name so that I can login to create & manage databases in Management Studio Express?
Please note that after re-installing WinXP Pro, my m/c. name has remained the same; I didn't change it.
Hi, I want to know what are the differencve between CONTAINS and LIKE, Which is better to use and in which condition.???? I searched on google but can't able to find out major differnces or any good article realted to this,
I have two numeric variables in T-SQL - @Var1 and @Var2These variables can be positive or negative. I want to find the difference between the two variables, eg:@Var1 = -50@Var2 = 25Difference = 25 @Var1 = -50@Var2 = -40Difference = 10 @Var1 = 60@Var2 = 10Difference = 50 Is there a function in SQL Server to carry this out?
It may be sound weird. I want to find the difference between SQL Stored procedure and functions. I knew a couple one is for function, parameter is must where as in SP its not, second is function would return a value whereas procedure wont.
I want to create a View, which contains columns from two tables, and an additional column, which should calculate the difference between two dates.01/05/2005 7:30 AM - 01/05/2005 8:00 AMThe column should be a calculated column,Can I assign the value of a column to a user defined function?In the UDF, how to get the difference between those two dates to be: "00:30"Are there SQL Server functions to time and date that allows me to do so? I have dateadd, datediff, but I am unable to figure out the 2 problems above.thank you,
In my table i have two cols and datatype datetime, for example they has the values,--------StartDate --------------------------------------- StopDate ------______________________________________________01/05/2005 7:30 AM ------------------------ 03/05/2005 10:00 AM13/05/2005 2:30 PM ------------------------- 01/08/2005 8:00 PM_____________________________________________How do I find out the avg time difference between StopDate and StartDate? I tried AVG(StopDate - StartDate ), but it's giving me the following error message. "The average aggregate operation cannot take a smalldatetime data type as an argument."Thanks for any reply.
I have a view in a database called PS_EMPLMT_SRCH_US and it joins around five tables. I have two databases which are identical structures including data. But when run one query ie "SELECT * FROM PS_EMPLMT_SRCH_US where EMPLID like '00918%' and OPRCLASS like 'ALLPANLS' ", response time is totally different even though both databases have same data and same indexes. When I looked at showplan and stats time, both are totally different and order of table fetch is totally different. Is there any idea why this difference? Any help would be appreciated.
Here is the show plan info: ------------------------------------------------------------------- GOOD Performance Query and plan -------------------------------------------------------------------
SELECT * FROM PS_EMPLMT_SRCH_US where EMPLID like '00918%' and OPRCLASS like 'ALLPANLS'
SQL Server Execution Times: CPU time = 0 ms, elapsed time = 0 ms. SQL Server parse and compile time: CPU time = 156 ms, elapsed time = 156 ms.
Hi I wanted to get difference between this two dates '12-31-2001','01-01-2002'). 1 day 0 month 0 year. Do we have any date function to get like this or we need write our own function stored proc?> Any advice please?.
Hi , I need logic for find the month diffrence. For example '08/05/2003','10/01/2003' I should get difference between these two date is 1. Thanks, Ravi