November 7, 2008 at 8:15 am
Hi All,
Its very urgent,Please can anyone help on this.
I have created a stored procedure to take UniqueIdentifier as parameter. I'm not able to pass UnqiueIdentifier value directly, hence I'm passing the value as varchar to stored procedure. In the stored procedure am converting the varchar to Unique Identifier, howevet it is giving error like "Syntax error converting from a character string to uniqueidentifier"
Id='42055BA3-8942-497A-8343-6B2FE9ACD48'
CREATE PROCEDURE [dbo].[verify_sp]
@userid Ident,
@Id Varchar(50)
as
Begin
select @AuthId=cast(@Id as UniqueIdentifier)
IF NOT EXISTS(select * from table1 where Id=@AuthId)
Begin
Raiserror (50004,11,1)
return 0
End
End
return 0
GO
Cheers,
nandy
November 10, 2008 at 4:38 am
Hi there,
Thanks a ton Now I can able to convert the value.
Cheers,
nandy
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply