// in a SQL query

  • Hello all,

    Someone recently sent me a query that contained a lot of // characters within the query. Has anyone ever used this in any of their queries, and is familiar with why this would be used in a query?

    Thanks!

    Damian

  • // is the default way to add a line of a comment in the C++ / C# /C#.Net language.

    most likely they just copied lots of stuff to give toy you, and the //mycomment stuff will raise errors, where you'll trim them out by commenting them with SQL comments.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Microsoft SQL Server supports 2 types of commenting:

    1. Single line: by using double hyphen "--", like:

    -- this is a single line comment

    2. Multiline: /* */, like:

    /*

    This

    is

    a

    multiline

    comment

    */

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

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