Unfamiliar Code

  • I have some code in a stored proc, but I am not sure of what the '@' char means. Please explain...

    Here is the code I am having trouble understanding:

    CREATE PROCEDURE [dbo].[RPT_Company_LIST]

    (

    @StartDate datetime = NULL,

    @EndDate datetime = NULL,

    @PrjName varchar(50) = '%',

    @TaskName varchar(50) = '%',

    @CoName varchar(50) = '%'

    )

    AS

  • the @ means its a parameter/variable which is used to run the query block

    eg

    delcare @name = 'Anthony'

    select * from users where name = @name

  • Have you even bothered to look this up in Books Online? The @ is the first character of a local variable or parameter.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply