This is the sproc I am calling from my Asp.Net application:
ALTER PROCEDURE [Uds].[Dashboard_GetJobs2]
@date as datetime = null
Select * From Uds.RealtimeLogging
Where (@date is null or [timeStamp] > @date)
If I ran from query analyzer I get the correct results:
exec Uds.Dashboard_GetJobs2 '9/20/2010 11:01:23 PM'
However, if I ran the Asp.Net page, ALL records are showed. Looking at the SQL Profiler I see the following call:
exec sp_executesql N'exec Uds.Dashboard_GetJobs2',N'@date nvarchar(21)',@date=N'9/20/2010 11:01:23 PM'
And if I ran the statement above in query analyzer it WILL return ALL records. Why????
View Complete Post