This is a discussion on Using NEWID() as a parameter to a stored procedure within the SQL Server forums, part of the Microsoft SQL Server category; --> Is it possible to use NEWID() as a parameter to a stored procedure in SQL Server 2000. I keep ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Is it possible to use NEWID() as a parameter to a stored procedure in SQL Server 2000. I keep getting a "Line 1: Incorrect syntax near ')'" error. ALTER PROCEDURE dbo.StoredProcedure1 ( @x uniqueidentifier ) AS /* SET NOCOUNT ON */ RETURN StoredProcedure1 NEWID() go "Line 1: Incorrect syntax near ')'" Thanks in advance |
| ||||
| You need to pass the value as a variable or literal: DECLARE @NewId uniqueidentifier SET @NewId = NEWID() EXEC StoredProcedure1 @NewId -- Hope this helps. Dan Guzman SQL Server MVP "A Rothberg" <arothberg@deloitte.com> wrote in message news:ec40cda9.0407101858.4aa4f140@posting.google.c om... > Is it possible to use NEWID() as a parameter to a stored procedure in > SQL Server 2000. I keep getting a "Line 1: Incorrect syntax near ')'" > error. > > ALTER PROCEDURE dbo.StoredProcedure1 > ( > @x uniqueidentifier > ) > AS > /* SET NOCOUNT ON */ > RETURN > > > StoredProcedure1 NEWID() > go > "Line 1: Incorrect syntax near ')'" > > Thanks in advance |