Mean Of @ symbol In Parameterized Query?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnagJohari
    New Member
    • May 2010
    • 96

    Mean Of @ symbol In Parameterized Query?

    I want to know the meaning of @ symbol In parameterized query.
    apart from this if i write an query like this
    Delete * From Client Where Id=@Id
    Can u explain the work Of @Id?
    its just like a variable in which we store the value & set in id or any diffrent thing.
    thank you
    or we can write @AnyName inplace of @Id while id is the column name in a database,
  • Jim Doherty
    Recognized Expert Contributor
    • Aug 2007
    • 897

    #2
    Originally posted by AnagJohari
    I want to know the meaning of @ symbol In parameterized query.
    apart from this if i write an query like this
    Delete * From Client Where Id=@Id
    Can u explain the work Of @Id?
    its just like a variable in which we store the value & set in id or any diffrent thing.
    thank you
    or we can write @AnyName inplace of @Id while id is the column name in a database,
    the @ is merely a set variable stating that the whatever is contained in @ (distinquished by the sequence of characters immediately following it) is to be understood as a parameter variable

    stating this:
    Code:
    Delete * From Client Where Id=Id
    will delete all records in your table

    whereas
    this:
    Code:
    Delete * From Client Where Id=@Id
    will delete only those records that match the value contained in the variable @Id

    You do not have to specifically use the term @Id it can be @Anyname or @ThisVariable or @MickeyMouse it really does not matter what you suffix @

    Comment

    Working...