Results 1 to 6 of 6

Thread: Is this right sql query???

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    UAE
    Posts
    191

    Is this right sql query???

    hello masters
    Please chek this statment...

    select * from stud_data,old_dont_use where [Sr No]=11 and old_dont_use.[Sr No]=stud_data.[Sr No]

    i think it is not valid statment.
    there are two tables stud_data and old_dont_use
    stud_data is master table and i want data from old.... as per sr no in stud_data

    so if it any change in it then please do it
    thnk you very muchh in advance
    Each New Difficulty Is Best Opportunity,
    If You Ignore Solving It,
    You Lost Your Life's Best Opportunity.
    _______________________________________
    Dynamic Property value assignment - C#
    TCP client/server connection

    CatchIt-Game
    Fortunes
    SQL Tutorials

  2. #2
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: Is this right sql query???

    Code:
    "SELECT stud_data.*, old_dont_use.* " & _
    "FROM stud_data INNER JOIN old_dont_use ON stud_data.[SR No] = old_dont_use.[SR No] " & _
    "WHERE stud_data.[SR No] = 11;"
    You might find the SQL tutorial in my sig useful

  3. #3
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266

    Re: Is this right sql query???

    Quote Originally Posted by MaximilianMayrhofer
    Code:
    "SELECT stud_data.*, old_dont_use.* " & _
    "FROM stud_data INNER JOIN old_dont_use ON stud_data.[SR No] = old_dont_use.[SR No] " & _
    "WHERE stud_data.[SR No] = 11;"
    You might find the SQL tutorial in my sig useful
    Beware of SQL injection
    jovton

  4. #4
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: Is this right sql query???

    say whaaat?

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Is this right sql query???

    In line SQL is open to outside hacking where database names, table names field names, etc can be obtained.

    Once obtained, it is not beyond the realm of possibility that malicious actions can be taken against your database.

    This is referred to as "Injection"

    To avoid possible SQL Injections, you should always use parametized queries or Stored Procedures.

    Having said that, however, I would be willing to bet that the overwhelming majority of development done throughout the world still uses in line SQL.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Is this right sql query???

    Note this Link

    I want to quote one passage:
    Quote Originally Posted by Wikipedia
    It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.
    Such as In-Line SQL

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