Results 1 to 9 of 9

Thread: What does this symbol mean ?

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    What does this symbol mean ?

    I do understand this code but I'm asking about this special symbol , what does it mean for SQL ?@ lol

    VB Code:
    1. cmd.CommandText = "INSERT INTO myTable (Name, RegisteredDate, CancelDate) " & _
    2.     "VALUES (@Name, @RegisteredDate, @CancelDate)"
    3. cmd.Parameters.Add("@Name", "Doug Seven")
    4. cmd.Parameters.Add("@RegisteredDate", DateTime.Today)
    5. 'Use System.DBNull.Value to leave the field uninitialized
    6. cmd.Parameters.Add("@CancelDate", System.DBNull.Value)

  2. #2
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148
    It is a variable

    e.g.

    DECLARE @my_thing CHAR(3)

    SELECT @my_thing = 'HI'

    SELECT @my_thing

    prints "HI"...

  3. #3

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Hmm , isn't here a string ?
    VB Code:
    1. cmd.Parameters.Add("@Name", "Doug Seven")
    isn't it the same as this ??
    VB Code:
    1. cmd.Parameters.Add("Name", "Doug Seven")

  4. #4
    Addicted Member
    Join Date
    Feb 2002
    Location
    closed
    Posts
    196
    in this case they refer to named arguments in a SQLServer Procedure

  5. #5

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by powdir
    in this case they refer to named arguments in a SQLServer Procedure
    I think so . I tried the code below and gives me error . It means , I can't use it with variables as Merrion said .
    VB Code:
    1. dim @a as String

  6. #6
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196
    Marion posted how they(variables) are declared inside the sproc.
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  7. #7

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You mean this stored procedure language (though I have no idea about it) . It could be . .

  8. #8
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Yah that is TransactSQL right? I've never fooled with stored procedures much.

    In any case you can't use that in VB code only in Sql Server stored procedures, triggers etc..
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  9. #9

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    oh TransactSQL ! Still confusing between them ...lol . I noticed that symbol only in SQL Server database .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width