SQL Server Performance

User Defined Data type to be used in SP

Discussion in 'SQL Server 2005 General Developer Questions' started by SQL2000DBA, Feb 20, 2007.

  1. SQL2000DBA New Member

    Hi,

    Please provide me whether their is any overheads in using user defined data type while declaring local variable in stored procedure.I am trying to find out if their is any overhead in using user Defined data type as local variable. Here is the code.

    ALTER procedure uspSelTMScheduleReportTest
    @tmpOfficeId varchar(10),
    @tmpTMId varchar(10),
    @InputWeek varchar(10),
    @tmpTeamId varchar(4)

    AS
    SET NOCOUNT ON
    declare @OfficeId udt_OfficeId,
    @TMId udt_TeamMemberID,
    @TeamId udt_TeamNumber

    Please provide your inputs.

    Thanks and Regards
    Ravi K
  2. DilliGrg Member

    quote:Originally posted by SQL2000DBA

    Hi,

    Please provide me whether their is any overheads in using user defined data type while declaring local variable in stored procedure.I am trying to find out if their is any overhead in using user Defined data type as local variable. Here is the code.

    ALTER procedure uspSelTMScheduleReportTest
    @tmpOfficeId varchar(10),
    @tmpTMId varchar(10),
    @InputWeek varchar(10),
    @tmpTeamId varchar(4)

    AS
    SET NOCOUNT ON
    declare @OfficeId udt_OfficeId,
    @TMId udt_TeamMemberID,
    @TeamId udt_TeamNumber

    Please provide your inputs.

    Thanks and Regards
    Ravi K


    Depends on the condition. Your query doesn't really tell us what you are trying to do. What kind of query(select/insert/update) you are trying to run? Why do you have to assign the values to the local variables? If you post your query, it will be easier to get response specific to your concern.

    Look BOL for @local_variable which should give you some idea.



    Thanks,

    Name
    ---------
    Dilli Grg

    (1 row(s) affected)

Share This Page