Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Report Passing Strange Data To SQL...
Message
General information
Forum:
ASP.NET
Category:
Reporting
Title:
Crystal Report Passing Strange Data To SQL...
Miscellaneous
Thread ID:
01451900
Message ID:
01451900
Views:
71
I have a Crystal report in my app that calls into a stored proc. Here's the proc:
CREATE PROCEDURE lb_GetContactReportData2
	@ContactName	VARCHAR(150) = NULL,
	@Family			VARCHAR(150) = NULL,
	@Title			VARCHAR(30) = NULL,
	@CompanyName	VARCHAR(50) = NULL,
	@Street1		VARCHAR(50) = NULL,
	@Street2		VARCHAR(50) = NULL,
	@City			VARCHAR(50) = NULL,
	@State			VARCHAR(2) = NULL,
	@ZipCode		VARCHAR(10) = NULL,
	@Category		VARCHAR(100) = NULL,
	@Subcategory	VARCHAR(100) = NULL

AS

	SELECT	c.ContactName, c.Family, c.Title, c.CompanyName, c.BirthDate,
			cat.Caption AS Category,
			a.Street1, a.Street2, a.City, a.State, a.ZipCode,
			e.EmailAddr,
			p.PhoneNum,
			w.WebSiteURL,
			cat.Caption AS Category,
			sc.Caption AS Subcategory
			FROM Contacts c
			JOIN Addresses a ON a.ContactId = c.RecordId AND a.IsPrimary = 1
			JOIN Phones p ON p.ContactId = c.RecordId AND p.IsPrimary = 1
			JOIN Emails e ON e.ContactId = c.RecordId AND e.IsPrimary = 1
			JOIN WebSites w ON w.ContactId = c.RecordId AND w.IsPrimary = 1
			JOIN Categories cat ON cat.RecordId = c.CategoryId
			JOIN Subcategories sc ON sc.RecordId = c.SubcategoryId
			WHERE c.ContactName LIKE '%' + @ContactName + '%' OR
				  c.Family LIKE '%' + @Family + '%' OR
				  c.Title LIKE '%' + @Title + '%' OR
				  c.CompanyName LIKE '%' + @CompanyName + '%' OR
				  a.Street1 LIKE '%' + @Street1 + '%' OR
				  a.Street2 LIKE '%' + @Street2 + '%' OR
				  a.City LIKE '%' + @City + '%' OR
				  a.State LIKE '%' + @State + '%' OR
				  a.ZipCode LIKE '%' + @ZipCode + '%' OR
				  cat.Caption LIKE '%' + @Category + '%' OR
				  sc.Caption LIKE '%' + @Subcategory + '%'
			ORDER BY ContactName, Title, CompanyName
Here's what SQL Profiler shows when I run the report:
exec "LBCMS"."dbo"."lb_GetContactReportData2";1 NULL, NULL, 'allstate', NULL, NULL, NULL, NULL, NULL, NULL, NULL
Notice the "; 1" after the proc name. I'm not sure where this is coming from. Anyone have any thoughts on this?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Reply
Map
View

Click here to load this message in the networking platform