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
Comments are closed.
Archive
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
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