Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Location
    Czech Republic
    Posts
    82

    Unanswered: How to enable properties syntax chceck...

    Is there any posibility how to avoid typist' s error?

    for example

    create proc up_....
    declare @ln_err
    ...
    ...

    select ln_err = @@error
    if ( @ln_err != 0 ) goto ERROR

    ...
    ...

    There is no problem to compile this command but there is semantic error in variable assign statement...

    Right should be:
    select @ln_err = @@error
    if ( @ln_err != 0 ) goto ERROR

    Is there any possibility to say to db engine that he should give warning for that mistakes???

    Thankx

    David

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Well, assigning column headings is not a mistake e.g.
    1> select zozo="tata"
    2> go
    zozo
    ----
    tata

    (1 row affected)

  3. #3
    Join Date
    Sep 2006
    Location
    Czech Republic
    Posts
    82
    Yes, I know that it is not mistake, but is there any possibility to avoid this?

    ...assigning column heading I shoul do by:

    1>select "tata" as zozo
    2>go

    zozo
    ----
    tata

    (1 row affected)

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    You can use the fipsflagger
    It will warn you when assigning column heading using the Non-ANSI = text
    Code:
    1> set fipsflagger on
    2> select 
    3>  e1=2e2
    4> ,2e2 e2
    5> ,2e2e3
    6> ,2e2'e4'
    7> ,2e2as e5
    8> ,2e2 as e6
    9> ,'e7'=2e2 
    10> go
    Line number 3 contains Non-ANSI text. The error is caused due to the use of column headings.
    Line number 9 contains Non-ANSI text. The error is caused due to the use of column headings.
     e1         e2         e3         e4         e5         e6         e7                   
     ---------- ---------- ---------- ---------- ---------- ---------- ---------- 
     200.000000 200.000000 200.000000 200.000000 200.000000 200.000000 200.000000

Posting Permissions

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