Agile Development, Architecture, .NET and The Art of Listening  RSS 2.0

Navigation
 Monday, December 24, 2007

USE AdventureWorks;
GO
-- Passing values as constants.
EXEC dbo.uspGetWhereUsedProductID 819, '20050225';
GO
-- Passing values as variables.
DECLARE @ProductID int, @CheckDate datetime;
SET @ProductID = 819;
SET @CheckDate = '20050225';
EXEC dbo.uspGetWhereUsedProductID @ProductID, @CheckDate;
GO
-- Try to use a function as a parameter value.
-- This produces an error message.
EXEC dbo.uspGetWhereUsedProductID 819, GETDATE();
GO
-- Passing the function value as a variable.
DECLARE @CheckDate datetime;
SET @CheckDate = GETDATE();
EXEC dbo.uspGetWhereUsedProductID 819, @CheckDate;
GO



http://msdn2.microsoft.com/en-us/library/ms189915.aspx
Monday, December 24, 2007 3:33:32 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
2005 | Performance Tuning | SQL Server | T-SQL | Useful stuff
Archive
<December 2007>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2009
Vlad Navazhylau
Sign In
Statistics
Total Posts: 174
This Year: 0
This Month: 0
This Week: 0
Comments: 1
All Content © 2009, Vlad Navazhylau