Showing posts with label below. Show all posts
Showing posts with label below. Show all posts

Sunday, March 25, 2012

Comparing One Table Field to another Table Field

I'm using SQL Server 2005 Express.

(Below are the three tables along with their fields)

1) tblEmailAddress Table
a) EmailAddress
b) Emailid (each EmailAddress has this corresponding Emailid)

2) tblEmailGroupLink Table
a) Emailid
b) Unsubscribed

3) Remove_List Table

a) EmailAddress


What I'd like to accomplish is...

A) To compare the EmailAddress field of all the records in the Remove_list Table to the EmailAddress field of all the records in the tblEmailAddress Table and if there is a match, get the Emailid field value.

B) Go to the tblEmailGroupLink Table and lookup the Emailid and change the value of the Unsubscribed field to 'True' for that record.

I'd appreciate any help I can get.

Thanks,

Bill


Hi, one sample would be:

UPDATE tblEmailGroupLink

SET UnSubscribed = 0x1
From tblEmailGroupLink L

INNER JOIN
(
Select E.EMailid
FROm tblEmailAddress E
INNER JOIN Remove_List R

ON E.EMailAddress = R.EMailAddress

) SubQUery
ON SubQUery.EMailid = L..EMailid

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Thank you for this Jens. Please keep in mind I'm very new at this, and am not sure of a few things.

Should I get into this database first, before I run a new Query? I did, but I want to be sure I'm doing this right, and when I run the Query this is what I got in a message.

Msg 207, Level 16, State 1, Line 11

Invalid column name ''.

Please let me know what you think... thanks Bill

|||You will have to be in the database where you want to change the values. The query had a typo:

ON SubQUery.EMailid = L.EMailid (only a single point after L)

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Thanks Jens, I'll give it a try.

Bill

|||

Jens,

Thanks, it works great.

Bill

Comparing One Table Field to another Table Field

I'm using SQL Server 2005 Express.

(Below are the three tables along with their fields)

1) tblEmailAddress Table
a) EmailAddress
b) Emailid (each EmailAddress has this corresponding Emailid)

2) tblEmailGroupLink Table
a) Emailid
b) Unsubscribed

3) Remove_List Table

a) EmailAddress


What I'd like to accomplish is...

A) To compare the EmailAddress field of all the records in the Remove_list Table to the EmailAddress field of all the records in the tblEmailAddress Table and if there is a match, get the Emailid field value.

B) Go to the tblEmailGroupLink Table and lookup the Emailid and change the value of the Unsubscribed field to 'True' for that record.

I'd appreciate any help I can get.

Thanks,

Bill


Hi, one sample would be:

UPDATE tblEmailGroupLink

SET UnSubscribed = 0x1
From tblEmailGroupLink L

INNER JOIN
(
Select E.EMailid
FROm tblEmailAddress E
INNER JOIN Remove_List R

ON E.EMailAddress = R.EMailAddress

) SubQUery
ON SubQUery.EMailid = L..EMailid

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Thank you for this Jens. Please keep in mind I'm very new at this, and am not sure of a few things.

Should I get into this database first, before I run a new Query? I did, but I want to be sure I'm doing this right, and when I run the Query this is what I got in a message.

Msg 207, Level 16, State 1, Line 11

Invalid column name ''.

Please let me know what you think... thanks Bill

|||You will have to be in the database where you want to change the values. The query had a typo:

ON SubQUery.EMailid = L.EMailid (only a single point after L)

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Thanks Jens, I'll give it a try.

Bill

|||

Jens,

Thanks, it works great.

Bill

sqlsql

Tuesday, March 20, 2012

Comparing CASE statement products

The query I have written below works fine. However, I now want to uncomment the WHERE clause below to find entries where the PatientAge does not fall between the PAGBeginningAge and PAGEndingAge. However, when I uncomment the WHERE clause line I receive the following error message:

Msg 156, Level 15, State 1, Line 28

Incorrect syntax near the keyword 'FROM'.

SELECT ampfm.rpt_AdtVisit.PatientFullName, ampfm.rpt_AdtVisit.AdmitPriorityCode, ampfm.dct_AdmitPriorityType.AdmitPriorityTypeName,

ampfm.rpt_AdtVisit.AccountNumber, ampfm.rpt_PatientDemographics.PatientAge, ampfm.rpt_PatientDemographics.PatientAgeGroup,

ampfm.rpt_PatientDemographics.PatientSex,

CASE WHEN PatientAgeGroup = '0 - 14' THEN '0' ELSE

CASE WHEN PatientAgeGroup = '15 - 24' THEN '15' ELSE

CASE WHEN PatientAgeGroup = '25 - 34' THEN '25' ELSE

CASE WHEN PatientAgeGroup = '35 - 44' THEN '35' ELSE

CASE WHEN PatientAgeGroup = '45 - 54' THEN '45' ELSE

CASE WHEN PatientAgeGroup = '55 - 64' THEN '55' ELSE

CASE WHEN PatientAgeGroup = '65 - 74' THEN '65' ELSE

CASE WHEN PatientAgeGroup = '75 - 79' THEN '75' ELSE

CASE WHEN PatientAgeGroup = '80 - OVER' THEN '80'

END END END END END END END END END AS PAGBeginningAge,

CASE WHEN PatientAgeGroup = '0 - 14' THEN '14' ELSE

CASE WHEN PatientAgeGroup = '15 - 24' THEN '24' ELSE

CASE WHEN PatientAgeGroup = '25 - 34' THEN '34' ELSE

CASE WHEN PatientAgeGroup = '35 - 44' THEN '44' ELSE

CASE WHEN PatientAgeGroup = '45 - 54' THEN '54' ELSE

CASE WHEN PatientAgeGroup = '55 - 64' THEN '64' ELSE

CASE WHEN PatientAgeGroup = '65 - 74' THEN '74' ELSE

CASE WHEN PatientAgeGroup = '75 - 79' THEN '79' ELSE

CASE WHEN PatientAgeGroup = '80 - OVER' THEN '200'

END END END END END END END END END AS PAGEndingAge

--WHERE PatientAge NOT BETWEEN PAGBeginningAge AND PAGEndingAge

FROM ampfm.dct_AdmitPriorityType INNER JOIN

ampfm.rpt_AdtVisit ON ampfm.dct_AdmitPriorityType.AdmitPriorityTypeCode = ampfm.rpt_AdtVisit.AdmitPriorityCode INNER JOIN

ampfm.rpt_PatientDemographics ON ampfm.rpt_AdtVisit.RegNum = ampfm.rpt_PatientDemographics.RegNum

Two things:

First, your WHERE statment needs to come after the last ON condition.

second, you are not allowed to alias the "column/expression list" of the SELECT clause like this in MS SQL Server as you can do from DB2; you will need to include the entire case statement in your WHERE clause.

You might be able to create an inline TVF to make this complicated CASE statement a little easier to read.

Maybe something like:

Code Snippet

alter function dbo.ageRange
( @.arg_ageGroup varchar(12)
)
returns table
as
return
( select cast(parsename(replace(@.arg_ageGroup,' - ','.'),2)
as int)
as lowPart,
cast( case when parsename(replace(@.arg_ageGroup,' - ','.'),1)
= 'over'
then '200'
else parsename(replace(@.arg_ageGroup,' - ','.'),1)
end as int)
as highPart
)

go

declare @.ageGroup table ( ageGroup varchar(9))
insert into @.ageGroup
select '0 - 14' union all
select '15 - 24' union all
select '25 - 34' union all
select '35 - 44' union all
select '45 - 54' union all
select '55 - 64' union all
select '65 - 74' union all
select '75 - OVER'

select ageGroup,
lowPart,
highPart
from @.ageGroup
cross apply ageRange(ageGroup)

Another idea would be to put your ranges in a table that included (1) the range, (2) the low and (3) the high of the range. Then you could use a CROSS APPLY to fetch the desired numeric LOW and HIGH of the range.

|||

I can't believe I had the WHERE statement before the FROM statement; boy this has been a long day.

I placed the entire case statement in the WHERE clause and everything is working fine now. Thanks!

BTW, I am not familiar with inline TVF. What is it or where could I read up on it?

|||

( I edited my previous response to include it; please take a look. )

|||

Thanks! I may try something like that on my next project.

sqlsql

Compare value

Hi,

I just start ti study SQL, Pls advice the solution for the case below :

I have 2 table : order_detail and ship_detail

Order_id Ship_id
Designation Designation
qty qty


I'd like to write the SQL command that show me the status of each order and the item is complete or non complete shipped

Thanks & Best regards
CitronWhat field ties the order detail to the ship detail (is ship_id the same as order_id ) ? What does the designation field store - how do you know when an item has been shipped or not ?

Sunday, March 11, 2012

Compare fields-two flat files-load data

Hi All,

I am totally new to SSIS and im in the learing phase. I have a requirement as below,

I have two flat files (mainframe files), the structure i have given below,

File1:

070113

12345johnk

23456james

1st row is header record which has got date in YYMMDD format and remaining rows have emp no and emp name

File2:

070113

070113

070113

070113

contains 4 records which are dates.

The requirement is to compare the header date in file1 with the 4 dates in file2, if they are equal then it should load all the records in file1 except the header into a table and if they donot match then it should log an err msg. Please could someone provide a lead on this.

The files have same record length and fixed field delimited.

Thanks in advance

raj

Dear SSISQuest,

1. Add 2 flatFile Source

2. Add 2 Sort transform for each FlatFile Source

3. Add Inner Join Transform and do a LEFT JOIN

4. Add SQL Destination or other!

Helped?

regards!

Saturday, February 25, 2012

Communication link failure.

What could cause the Microsoft error listed below?
[Microsoft][ODBC SQL Server Driver]Communication link failure.
Thanks,Hi
Loosing connectivity to the server.
In what scenario does this occur?
Normally, network connectivity problems between a server and a client are
caused by faulty network cards, cables and switches. Also check that your
network drivers are up to date.
Regards
Mike
"Joe K." wrote:
> What could cause the Microsoft error listed below?
> [Microsoft][ODBC SQL Server Driver]Communication link failure.
> Thanks,

Friday, February 24, 2012

Common Generation Watermark error for Merge Replication

Hello,

We have a sqlexpress subscriber that is receiving the error below. SQL Server 2005

We have tried:

    Generate new snapshot.

    Reinitialize the subscription.

    Dropped the subscription.

    Reboot the web server box.

    Reboot the sql server box.

Yet we still get the errors for these specific subscribers. Any ideas?

Error in replication monitor....

Error messages:

The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800

Can you offer more details on how your merge topology is set up? How are the machines layed out and what version of SQL Server 2005 is on each, RTM or SP1? I am also interested in the publication, article, and subscription settings. Perhaps you could post the publication and subscription scripts. Any other info you can offer on repro steps would be helpful.

Thanks,

Tom

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Did you manage to resolve this issue in the end? I'm getting the same error periodically here, so I'd be interested to know if you managed to get it fixed.

Cheers

Nick Hoggard

|||

The same problems occurs in my situation. 9 identical notebooks, each of them synchronizing using filters with SUSER_SNAME() rule. 2 of them stops with the same message. Have no idea what to do.

|||

Same problem here!

Some subscriptions fail with this error.
I really need a way to resolve this at the server as the subscribers are in the field.

Some more Info:
We have about 200 subscriptions and at the moment this problem appears at two of them.

At the client the error is 29006, which is not helping.

|||Unfortunately these issues are very very difficult to debug on a forum, I highly suggest opening a support case so you can have an engineer dig deeper into the problem.|||

Did anything ever get resolved for this? We are having same problem.

thx,

jg

|||Can you describe your problem scenario or the sequence of events that have led you to this failure please?|||I am receiving the same error. I have pretty much the same architecture in place. The error seems to center around the Upload changes first.|||Hi all,

found this one in Microsoft site.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=256575&wa=wsignin1.0

Thank you.|||

Do these forums ever get checked? I experienced a similar problem, if not the same problem.

I have a publication that includes Views, SPs, and Functions only. The publication was running successfully on a SQL Express SP2 subscriber, but failed with the error message stated previously in this topic. I had to mark the subscriber as needing to reinitialize and then the publication got passed the error. No changes were made to the articles or publication to cause the error.

Thanks in advance,

Graham

|||

As mentioned above, please create a case with Customer Support so you cna have an engineer debug your issue, especially if this is blocking or hindering your production system.

Common Generation Watermark error for Merge Replication

Hello,

We have a sqlexpress subscriber that is receiving the error below. SQL Server 2005

We have tried:

    Generate new snapshot.

    Reinitialize the subscription.

    Dropped the subscription.

    Reboot the web server box.

    Reboot the sql server box.

Yet we still get the errors for these specific subscribers. Any ideas?

Error in replication monitor....

Error messages:

The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800

Can you offer more details on how your merge topology is set up? How are the machines layed out and what version of SQL Server 2005 is on each, RTM or SP1? I am also interested in the publication, article, and subscription settings. Perhaps you could post the publication and subscription scripts. Any other info you can offer on repro steps would be helpful.

Thanks,

Tom

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Did you manage to resolve this issue in the end? I'm getting the same error periodically here, so I'd be interested to know if you managed to get it fixed.

Cheers

Nick Hoggard

|||

The same problems occurs in my situation. 9 identical notebooks, each of them synchronizing using filters with SUSER_SNAME() rule. 2 of them stops with the same message. Have no idea what to do.

|||

Same problem here!

Some subscriptions fail with this error.
I really need a way to resolve this at the server as the subscribers are in the field.

Some more Info:
We have about 200 subscriptions and at the moment this problem appears at two of them.

At the client the error is 29006, which is not helping.

|||Unfortunately these issues are very very difficult to debug on a forum, I highly suggest opening a support case so you can have an engineer dig deeper into the problem.|||

Did anything ever get resolved for this? We are having same problem.

thx,

jg

|||Can you describe your problem scenario or the sequence of events that have led you to this failure please?|||I am receiving the same error. I have pretty much the same architecture in place. The error seems to center around the Upload changes first.|||Hi all,

found this one in Microsoft site.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=256575&wa=wsignin1.0

Thank you.|||

Do these forums ever get checked? I experienced a similar problem, if not the same problem.

I have a publication that includes Views, SPs, and Functions only. The publication was running successfully on a SQL Express SP2 subscriber, but failed with the error message stated previously in this topic. I had to mark the subscriber as needing to reinitialize and then the publication got passed the error. No changes were made to the articles or publication to cause the error.

Thanks in advance,

Graham

|||

As mentioned above, please create a case with Customer Support so you cna have an engineer debug your issue, especially if this is blocking or hindering your production system.

Common Generation Watermark error for Merge Replication

Hello,

We have a sqlexpress subscriber that is receiving the error below. SQL Server 2005

We have tried:

    Generate new snapshot. Reinitialize the subscription. Dropped the subscription. Reboot the web server box. Reboot the sql server box.

Yet we still get the errors for these specific subscribers. Any ideas?

Error in replication monitor....

Error messages:

The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800

Can you offer more details on how your merge topology is set up? How are the machines layed out and what version of SQL Server 2005 is on each, RTM or SP1? I am also interested in the publication, article, and subscription settings. Perhaps you could post the publication and subscription scripts. Any other info you can offer on repro steps would be helpful.

Thanks,

Tom

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Did you manage to resolve this issue in the end? I'm getting the same error periodically here, so I'd be interested to know if you managed to get it fixed.

Cheers

Nick Hoggard

|||

The same problems occurs in my situation. 9 identical notebooks, each of them synchronizing using filters with SUSER_SNAME() rule. 2 of them stops with the same message. Have no idea what to do.

|||

Same problem here!

Some subscriptions fail with this error.
I really need a way to resolve this at the server as the subscribers are in the field.

Some more Info:
We have about 200 subscriptions and at the moment this problem appears at two of them.

At the client the error is 29006, which is not helping.

|||Unfortunately these issues are very very difficult to debug on a forum, I highly suggest opening a support case so you can have an engineer dig deeper into the problem.|||

Did anything ever get resolved for this? We are having same problem.

thx,

jg

|||Can you describe your problem scenario or the sequence of events that have led you to this failure please?|||I am receiving the same error. I have pretty much the same architecture in place. The error seems to center around the Upload changes first.|||Hi all,

found this one in Microsoft site.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=256575&wa=wsignin1.0

Thank you.
|||

Do these forums ever get checked? I experienced a similar problem, if not the same problem.

I have a publication that includes Views, SPs, and Functions only. The publication was running successfully on a SQL Express SP2 subscriber, but failed with the error message stated previously in this topic. I had to mark the subscriber as needing to reinitialize and then the publication got passed the error. No changes were made to the articles or publication to cause the error.

Thanks in advance,

Graham

|||

As mentioned above, please create a case with Customer Support so you cna have an engineer debug your issue, especially if this is blocking or hindering your production system.

Common Generation Watermark error for Merge Replication

Hello,

We have a sqlexpress subscriber that is receiving the error below. SQL Server 2005

We have tried:

    Generate new snapshot.

    Reinitialize the subscription.

    Dropped the subscription.

    Reboot the web server box.

    Reboot the sql server box.

Yet we still get the errors for these specific subscribers. Any ideas?

Error in replication monitor....

Error messages:

The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800

Can you offer more details on how your merge topology is set up? How are the machines layed out and what version of SQL Server 2005 is on each, RTM or SP1? I am also interested in the publication, article, and subscription settings. Perhaps you could post the publication and subscription scripts. Any other info you can offer on repro steps would be helpful.

Thanks,

Tom

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Did you manage to resolve this issue in the end? I'm getting the same error periodically here, so I'd be interested to know if you managed to get it fixed.

Cheers

Nick Hoggard

|||

The same problems occurs in my situation. 9 identical notebooks, each of them synchronizing using filters with SUSER_SNAME() rule. 2 of them stops with the same message. Have no idea what to do.

|||

Same problem here!

Some subscriptions fail with this error.
I really need a way to resolve this at the server as the subscribers are in the field.

Some more Info:
We have about 200 subscriptions and at the moment this problem appears at two of them.

At the client the error is 29006, which is not helping.

|||Unfortunately these issues are very very difficult to debug on a forum, I highly suggest opening a support case so you can have an engineer dig deeper into the problem.|||

Did anything ever get resolved for this? We are having same problem.

thx,

jg

|||Can you describe your problem scenario or the sequence of events that have led you to this failure please?|||I am receiving the same error. I have pretty much the same architecture in place. The error seems to center around the Upload changes first.|||Hi all,

found this one in Microsoft site.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=256575&wa=wsignin1.0

Thank you.|||

Do these forums ever get checked? I experienced a similar problem, if not the same problem.

I have a publication that includes Views, SPs, and Functions only. The publication was running successfully on a SQL Express SP2 subscriber, but failed with the error message stated previously in this topic. I had to mark the subscriber as needing to reinitialize and then the publication got passed the error. No changes were made to the articles or publication to cause the error.

Thanks in advance,

Graham

|||

As mentioned above, please create a case with Customer Support so you cna have an engineer debug your issue, especially if this is blocking or hindering your production system.

Common Generation Watermark error for Merge Replication

Hello,

We have a sqlexpress subscriber that is receiving the error below. SQL Server 2005

We have tried:

    Generate new snapshot.

    Reinitialize the subscription.

    Dropped the subscription.

    Reboot the web server box.

    Reboot the sql server box.

Yet we still get the errors for these specific subscribers. Any ideas?

Error in replication monitor....

Error messages:

The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800

Can you offer more details on how your merge topology is set up? How are the machines layed out and what version of SQL Server 2005 is on each, RTM or SP1? I am also interested in the publication, article, and subscription settings. Perhaps you could post the publication and subscription scripts. Any other info you can offer on repro steps would be helpful.

Thanks,

Tom

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Did you manage to resolve this issue in the end? I'm getting the same error periodically here, so I'd be interested to know if you managed to get it fixed.

Cheers

Nick Hoggard

|||

The same problems occurs in my situation. 9 identical notebooks, each of them synchronizing using filters with SUSER_SNAME() rule. 2 of them stops with the same message. Have no idea what to do.

|||

Same problem here!

Some subscriptions fail with this error.
I really need a way to resolve this at the server as the subscribers are in the field.

Some more Info:
We have about 200 subscriptions and at the moment this problem appears at two of them.

At the client the error is 29006, which is not helping.

|||Unfortunately these issues are very very difficult to debug on a forum, I highly suggest opening a support case so you can have an engineer dig deeper into the problem.|||

Did anything ever get resolved for this? We are having same problem.

thx,

jg

|||Can you describe your problem scenario or the sequence of events that have led you to this failure please?|||I am receiving the same error. I have pretty much the same architecture in place. The error seems to center around the Upload changes first.|||Hi all,

found this one in Microsoft site.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=256575&wa=wsignin1.0

Thank you.|||

Do these forums ever get checked? I experienced a similar problem, if not the same problem.

I have a publication that includes Views, SPs, and Functions only. The publication was running successfully on a SQL Express SP2 subscriber, but failed with the error message stated previously in this topic. I had to mark the subscriber as needing to reinitialize and then the publication got passed the error. No changes were made to the articles or publication to cause the error.

Thanks in advance,

Graham

|||

As mentioned above, please create a case with Customer Support so you cna have an engineer debug your issue, especially if this is blocking or hindering your production system.

Common Generation Watermark error for Merge Replication

Hello,

We have a sqlexpress subscriber that is receiving the error below. SQL Server 2005

We have tried:

    Generate new snapshot. Reinitialize the subscription. Dropped the subscription. Reboot the web server box. Reboot the sql server box.

Yet we still get the errors for these specific subscribers. Any ideas?

Error in replication monitor....

Error messages:

The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800

Can you offer more details on how your merge topology is set up? How are the machines layed out and what version of SQL Server 2005 is on each, RTM or SP1? I am also interested in the publication, article, and subscription settings. Perhaps you could post the publication and subscription scripts. Any other info you can offer on repro steps would be helpful.

Thanks,

Tom

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Did you manage to resolve this issue in the end? I'm getting the same error periodically here, so I'd be interested to know if you managed to get it fixed.

Cheers

Nick Hoggard

|||

The same problems occurs in my situation. 9 identical notebooks, each of them synchronizing using filters with SUSER_SNAME() rule. 2 of them stops with the same message. Have no idea what to do.

|||

Same problem here!

Some subscriptions fail with this error.
I really need a way to resolve this at the server as the subscribers are in the field.

Some more Info:
We have about 200 subscriptions and at the moment this problem appears at two of them.

At the client the error is 29006, which is not helping.

|||Unfortunately these issues are very very difficult to debug on a forum, I highly suggest opening a support case so you can have an engineer dig deeper into the problem.|||

Did anything ever get resolved for this? We are having same problem.

thx,

jg

|||Can you describe your problem scenario or the sequence of events that have led you to this failure please?|||I am receiving the same error. I have pretty much the same architecture in place. The error seems to center around the Upload changes first.|||Hi all,

found this one in Microsoft site.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=256575&wa=wsignin1.0

Thank you.
|||

Do these forums ever get checked? I experienced a similar problem, if not the same problem.

I have a publication that includes Views, SPs, and Functions only. The publication was running successfully on a SQL Express SP2 subscriber, but failed with the error message stated previously in this topic. I had to mark the subscriber as needing to reinitialize and then the publication got passed the error. No changes were made to the articles or publication to cause the error.

Thanks in advance,

Graham

|||

As mentioned above, please create a case with Customer Support so you cna have an engineer debug your issue, especially if this is blocking or hindering your production system.

Common Generation Watermark error for Merge Replication

Hello,

We have a sqlexpress subscriber that is receiving the error below. SQL Server 2005

We have tried:

    Generate new snapshot. Reinitialize the subscription. Dropped the subscription. Reboot the web server box. Reboot the sql server box.

Yet we still get the errors for these specific subscribers. Any ideas?

Error in replication monitor....

Error messages:

The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800

Can you offer more details on how your merge topology is set up? How are the machines layed out and what version of SQL Server 2005 is on each, RTM or SP1? I am also interested in the publication, article, and subscription settings. Perhaps you could post the publication and subscription scripts. Any other info you can offer on repro steps would be helpful.

Thanks,

Tom

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hi,

Did you manage to resolve this issue in the end? I'm getting the same error periodically here, so I'd be interested to know if you managed to get it fixed.

Cheers

Nick Hoggard

|||

The same problems occurs in my situation. 9 identical notebooks, each of them synchronizing using filters with SUSER_SNAME() rule. 2 of them stops with the same message. Have no idea what to do.

|||

Same problem here!

Some subscriptions fail with this error.
I really need a way to resolve this at the server as the subscribers are in the field.

Some more Info:
We have about 200 subscriptions and at the moment this problem appears at two of them.

At the client the error is 29006, which is not helping.

|||Unfortunately these issues are very very difficult to debug on a forum, I highly suggest opening a support case so you can have an engineer dig deeper into the problem.|||

Did anything ever get resolved for this? We are having same problem.

thx,

jg

|||Can you describe your problem scenario or the sequence of events that have led you to this failure please?|||I am receiving the same error. I have pretty much the same architecture in place. The error seems to center around the Upload changes first.|||Hi all,

found this one in Microsoft site.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=256575&wa=wsignin1.0

Thank you.
|||

Do these forums ever get checked? I experienced a similar problem, if not the same problem.

I have a publication that includes Views, SPs, and Functions only. The publication was running successfully on a SQL Express SP2 subscriber, but failed with the error message stated previously in this topic. I had to mark the subscriber as needing to reinitialize and then the publication got passed the error. No changes were made to the articles or publication to cause the error.

Thanks in advance,

Graham

|||

As mentioned above, please create a case with Customer Support so you cna have an engineer debug your issue, especially if this is blocking or hindering your production system.

Thursday, February 16, 2012

comment in column definition

Plesae tell me the MSSQL Server equivalent of the below MySQL query .
create table temp2(a varchar(23) comment 'male m');
What is the use of specifying a keyword 'comment' in the column definition. Will it make any differenceThat create table statement does not work in SQL Server. What RDBMS are you using?|||Sorry , the above SQL Query is in MySQL Syntax . Could you please tell me the equivalent in MSSQL Server.|||Is comment setting a default?|||Actually it looks more like SPSS value labels or the like. If so - no- you need to set up another table and establish a foreign key.|||I'm guessing that you are trying to add a comment to your column to indicate what it is for. Depending on your version of SQL Server, you will have to use a separate syntax:

SQL 2000

sp_addextendedproperty 'Caption', 'US Phone Number',
'user', dbo, 'table', TestExProp, 'column', USPhoneNmbr

SQL 2005:

EXEC sys.sp_addextendedproperty
@.name = N'MS_DescriptionExample',
@.value = N'Minimum inventory quantity.',
@.level0type = N'SCHEMA', @.level0name = Production,
@.level1type = N'TABLE', @.level1name = Product,
@.level2type = N'COLUMN', @.level2name = SafetyStockLevel;
GO

Regards,

hmscott|||I think the 2000 syntax works on 2005 as well actually, for backwards compatibility.|||I think the 2000 syntax works on 2005 as well actually, for backwards compatibility.

prolly, but no sense in making it easy for him...

:D

hmscott|||in that case you should have given him the 2007 syntax. ;)|||in that case you should have given him the 2007 syntax. ;)

That's the new "virtual" syntax. You just think about it and it appears...

:D

hmscott|||FYI:
http://www.dbforums.com/showthread.php?p=6270444#post6270444

Thanks for trying to find out krReddy|||I am creating a table in SQL Server using the below query.

CREATE TABLE temp(
type21 varchar(1) default NULL /*where the COMMENT will be saved'*/)

In the above query there is a comment line enclosed in /* and */ .
This query is executable .

Please tell me where will this comment line be saved in SQL Server database .

I have checked this in SYSCOMMENTS but i didn't found .

If it is saved some where in the database , Plz tell me the query to fetch that comment

Thanks|||Syscomments is something else entirly. You know that the stuff /* here */ is commented out (a different sort of meaning for comment) and as such does not get executed. It is not stored anywhere. As far as SQL Server is concerned it does not exist - it is for the coders use only.|||If it is saved some where in the database ...it isn't :)|||it isn't :)Sigh - if only I could be so concise.

Why use twenty words when two\ three will do.

Indeed - why write all that at all?|||sorry, pootsie, did not mean to trample your fine post

i was busy merging this guy's threads and so i missed your reply|||Nowt trampled & no worries.