troubleshooting Question

Cannot call methods on uniqueidentifier

Avatar of Soluga
Soluga asked on
Microsoft SQL Server 2008Microsoft SQL Server 2005
3 Comments1 Solution1837 ViewsLast Modified:

When I try to run the stored proc below, I keep getting the error "Cannot call methods on uniqueidentifier."

This is to do with my AND statement. All the id's are uniqueidentifiers.

Would be grateful for any help.

alter PROCEDURE usp_M05_GetAllOptionalWorkgroups
	-- Add the parameters for the stored procedure here
	@onlineCourseID Uniqueidentifier
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.

    SELECT     tbl_M04_Wgs.WorkgroupID, tbl_M04_Wgs.WorkGroupName, CONVERT(Int, tbl_M04_Wgs.WorkGroupStatus) AS Status, tbl_M05_OCOWA.OptionalAssignmentID
FROM         tbl_M04_Workgroups AS tbl_M04_Wgs LEFT OUTER JOIN
                      tbl_M05_OnlineCourseOptionalWorkGroupAssignments AS tbl_M05_OCOWA ON tbl_M04_Wgs.WorkgroupID = tbl_M05_OCOWA.OptionalWorkGroupID
WHERE     (tbl_M04_Wgs.WorkGroupStatus = '1') AND (tbl_M04_Wgs.WorkgroupID.WorkgroupID NOT IN
                          (SELECT     MandatoryWorkGroupID
                            FROM          tbl_M05_OnlineCourseMandatoryWorkGroupAssignments AS tbl_M05_OCMWA
                            WHERE      (MandatoryWorkGroupID = @onlineCourseID)))
ORDER BY tbl_M04_Wgs.WorkGroupName

Open in new window

Paul Jackson
Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2011

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros