Showing posts with label knowledge. Show all posts
Showing posts with label knowledge. Show all posts

Monday, March 26, 2012

Outer Join problems

This may or may not be due to my lack of knowledge on the use of outer join. I am getting the error:

Server: Msg 208, Level 16, State 1, Line 1

Invalid object name 'IncidentId'.

From my query:

SELECT Incident_Incidents.RelatedIncidentId,

Incident_Incidents.RelatedType,

Incident.Subject,

Incident.RecordId

From Incident_Incidents, Incident

left outer join IncidentId on Incident.IncidentId = Incident_Incidents.IncidentId

where Incident.IncidentId = 12838

Any ideas?

SELECT

Y.RelatedIncidentId,

X.RelatedType,

X.Subject,

X.RecordId

From

Incident_Incidents X

LEFT OUTER JOIN Incident Y

ON

X.IncidentId = Y.IncidentId

where X.IncidentId = 12838

|||Sorry not to clear on what you've got going on here, Tried running it with no luck|||

Here is a sample of some real code; I might of have mistaken some of your field name. It looks like your trying to left outer join on a column name instead of a table name, which will not work.

SELECT

P.iPLANID

FROM

PLANS P

INNER JOIN Units M

ON M.iPlanid = P.iPlanid

|||

my guess:

SELECT Incident_Incidents.RelatedIncidentId,

Incident_Incidents.RelatedType,

Incident.Subject,

Incident.RecordId

From Incident_Incidents

left outer join Incident on Incident.IncidentId = Incident_Incidents.RelatedIncidentId

where Incident.IncidentId = 12838

Monday, February 20, 2012

OS Error 5 during initial snapshot

I'm trying SQL Server replication for the first time. I have read a lot of posts on several forums and gone through Microsoft knowledge base articles and books online.

I have SQL Server Evaluation edition running on one Windows XP machine. (server)

I have MSDE 2000 on another Windows XP machine. (subscriber)

Both have Service Pack 3.

I have setup a publication on the server and have successfully created a pull subscripton on the subcriber.

I have a domain user account with admin privs on the server machine that is used as the SQL Server account login and SQL Server Agent login.

I have setup the ..MSSQL\REPLDATA directory as a public share and given the SQL Server Agent Account full permissions and privs - per MS KB#240688

When trying to synchronize my pull subscription I STILL get the error below.

What gives? I'm pulling out my hair now. This is obviously a permissions problem but I can't for the life of me figure out who needs what permissions and where.

Does the subscriber have to have a domain user account for anonymous subscriptions?

PARTIAL ERROR MESSAGE FROM LOG FILE:

The schema script '\\MyServer\Repldata\unc\MyServer_testdb_Lookups\2 0031210105855\PARM_LIST_1.sch' could not be propagated to the subscriber.
[12/10/2003 11:13:34 AM]E39726.test1: {call sp_reinitmergepullsubscription (N'MyServer', N'testdb', N'Lookups', 'FALSE')}
Reinitialized pull subscription to publication 'Lookups' from publisher 'MyServer:testdb'Percent Complete: 0
The subscription has been marked for reinitialization. Reinitialization will occur the next time you synchronize this subscription.
Percent Complete: 0
The schema script '\\MyServer\Repldata\unc\MyServer_testdb_Lookups\2 0031210105855\PARM_LIST_1.sch' could not be propagated to the subscriber.
Percent Complete: 0
Category:NULL
Source: Merge Replication Provider
Number: -2147201001
Message: The schema script '\\MyServer\Repldata\unc\MyServer_testdb_Lookups\2 0031210105855\PARM_LIST_1.sch' could not be propagated to the subscriber.
Percent Complete: 0
Category:AGENT
Source: E39726
Number: 0
Message: The process could not read file '\\MyServer\Repldata\unc\MyServer_testdb_Lookups\2 0031210105855\PARM_LIST_1.sch' due to OS error 5.
Percent Complete: 0
Category:OS
Source:
Number: 5
Message: Access is denied.Does your subscriber has enough previlege to access the publisher and the publication?|||Originally posted by joejcheng
Does your subscriber has enough previlege to access the publisher and the publication?

Maybe this is where I need the help. As far as I can determine my subscriber can access the publisher and the publication. As I read through the log of the sycnchronization steps I see

Connecting to subscriber
Connecting to distributor
Connecting to publisher
Retrieving publication information
Retrieving subscription information

All of these steps complete with no error I only get the error when the synch job starts to read the snapshot files

I can get to the files from the subscription PC, I can even copy them, open them, delete them. I don't know what gives.|||Originally posted by joejcheng
Does your subscriber has enough previlege to access the publisher and the publication?

Maybe this is where I need the help. As far as I can determine my subscriber can access the publisher and the publication. As I read through the log of the sycnchronization steps I see

Connecting to subscriber
Connecting to distributor
Connecting to publisher
Retrieving publication information
Retrieving subscription information

All of these steps complete with no error I only get the error when the synch job starts to read the snapshot files

I can get to the files from the subscription PC, I can even copy them, open them, delete them. I don't know what gives.