Oct 10, 2001 #1 VBXL Programmer Jul 10, 2001 198 GB Hi Is it possible to have local variables to stored procedure. I want to create some variables inside the stored procedure that i dont have to call Cheers Xplain
Hi Is it possible to have local variables to stored procedure. I want to create some variables inside the stored procedure that i dont have to call Cheers Xplain
Oct 10, 2001 #2 salma Technical User Aug 21, 2001 13 GB declare @local_var_name Be sure to start the var name with an '@' or it won't validate thanks Salma Upvote 0 Downvote
Oct 10, 2001 #3 salma Technical User Aug 21, 2001 13 GB sorry forgot the datatye declare @local_var_name datatype e.g. declare @temp int Upvote 0 Downvote
Oct 10, 2001 #4 RickCole Technical User May 9, 2001 349 GB Yes it is possible to use local variables. Have a look at the following topic in BOL: DECLARE @local_variable (T-SQL) Rick. Upvote 0 Downvote
Yes it is possible to use local variables. Have a look at the following topic in BOL: DECLARE @local_variable (T-SQL) Rick.
Oct 10, 2001 Thread starter #5 VBXL Programmer Jul 10, 2001 198 GB Is it possible to have User Defined Types in a stored procedure i.e private type Example a int b varchar c int End Type Upvote 0 Downvote
Is it possible to have User Defined Types in a stored procedure i.e private type Example a int b varchar c int End Type
Oct 10, 2001 #6 RickCole Technical User May 9, 2001 349 GB Not sure if I fully understand your question but the following example is perfectly acceptable. CREATE PROCEDURE upz_variables AS SET NOCOUNT ON declare @internal_var1 int declare @internal_var2 varchar(5) declare @internal_var3 datetime Set @internal_var1 = 1 Set @internal_var2 = 'Text5' Set @internal_var3 = (select getdate()) Rick. Upvote 0 Downvote
Not sure if I fully understand your question but the following example is perfectly acceptable. CREATE PROCEDURE upz_variables AS SET NOCOUNT ON declare @internal_var1 int declare @internal_var2 varchar(5) declare @internal_var3 datetime Set @internal_var1 = 1 Set @internal_var2 = 'Text5' Set @internal_var3 = (select getdate()) Rick.