List Info

Thread: RE: T-SQL help




RE: T-SQL help
country flaguser name
United States
2007-12-12 14:02:45
Ok.  Yeah was just looking through the online help with
SQL2005 and didn't 
see anything mentioned about boolean (except for some
chicken soup 
recipes... lol j/k  )

Thanks Bill for pointing that out..



Jim MacDiarmid
CACI 
4795 Meadow Wood Lane 
Chantilly, VA. 20151-2222
Voice (703) 679-5454



"Bill Swartz" <bswartzbubbyzone.com> 
12/12/2007 02:57 PM
Please respond to
aspnet-databasesaspadvice.com


To
aspnet-databasesaspadvice.com
cc

Subject
[aspnet-databases] RE: T-SQL help






You can't do this.  There is no such thing as a
"Boolean" variable. 

IF NOT newCommand              <<- Error starts here

Change it to IF (newCommand = 0)

Bill

-----Original Message-----
From: bounce-aspnet-databases-58376aspadvice.com
[mailto:bounce-aspnet-databases-58376aspadvice.com] On Behalf Of
James
Macdiarmid
Sent: Wednesday, December 12, 2007 10:14 AM
To: aspnet-databasesaspadvice.com
Subject: [aspnet-databases] T-SQL help

This is a snip from a larger Sproc and I'm getting the below
error. Any 
ideas what might be going wrong here or should I include the
entire sproc?

if type = 1
        BEGIN
                IF NOT newCommand              <<- Error
starts here
                        BEGIN
                                select rtrim(fy) as fy FROM
                                (
                                select 'X' as fy
                                        union all
                                        select fy from
[dbo].[lu_fy] with 
(nolock)
                                ) x
                                order by isnumeric(fy)
                        END
                ELSE
                        BEGIN
                                SELECT DISTINCT [fy] 
                                FROM [dbo].FC_FY WITH
(NOLOCK)
                                WHERE [fy] IN (SELECT [fy]
from [dbo].
[LU_FY] WHERE [currency] = 'CURRENT')
                                ORDER BY [fy]
                        END
        END


Msg 4145, Level 15, State 1, Procedure
p_FC_GET_APC_EDIT_FILTER, Line 22
An expression of non-boolean type specified in a context
where a condition 

is expected, near 'BEGIN'.
Msg 156, Level 15, State 1, Procedure
p_FC_GET_APC_EDIT_FILTER, Line 31
Incorrect syntax near the keyword 'ELSE'.

Thanks in advance!

 
Jim MacDiarmid
CACI 
4795 Meadow Wood Lane 
Chantilly, VA. 20151-2222
Voice (703) 679-5454


Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com


Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com





Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com

RE: T-SQL help
country flaguser name
United States
2007-12-21 08:32:25
Have you tried:
BEGIN
                IF NOT(newCommand is null)             <<-
Error starts
here
                        BEGIN
                                select rtrim(fy) as fy FROM
                                (
                                select 'X' as fy
                                        union all
                                        select fy from
[dbo].[lu_fy] with
(nolock)
                                ) x
                                order by isnumeric(fy)
                        END

----- Original Message ----- 
From: "James Macdiarmid" <jmacdiarmidcaci.com>
To: <aspnet-databasesaspadvice.com>
Sent: Wednesday, December 12, 2007 3:02 PM
Subject: [aspnet-databases] RE: T-SQL help


> Ok.  Yeah was just looking through the online help with
SQL2005 and didn't
> see anything mentioned about boolean (except for some
chicken soup
> recipes... lol j/k  )
>
> Thanks Bill for pointing that out..
>
>
>
> Jim MacDiarmid
> CACI
> 4795 Meadow Wood Lane
> Chantilly, VA. 20151-2222
> Voice (703) 679-5454
>
>
>
> "Bill Swartz" <bswartzbubbyzone.com>
> 12/12/2007 02:57 PM
> Please respond to
> aspnet-databasesaspadvice.com
>
>
> To
> aspnet-databasesaspadvice.com
> cc
>
> Subject
> [aspnet-databases] RE: T-SQL help
>
>
>
>
>
>
> You can't do this.  There is no such thing as a
"Boolean" variable.
>
> IF NOT newCommand              <<- Error starts here
>
> Change it to IF (newCommand = 0)
>
> Bill
>
> -----Original Message-----
> From: bounce-aspnet-databases-58376aspadvice.com
> [mailto:bounce-aspnet-databases-58376aspadvice.com] On Behalf Of James
> Macdiarmid
> Sent: Wednesday, December 12, 2007 10:14 AM
> To: aspnet-databasesaspadvice.com
> Subject: [aspnet-databases] T-SQL help
>
> This is a snip from a larger Sproc and I'm getting the
below error. Any
> ideas what might be going wrong here or should I
include the entire sproc?
>
> if type = 1
>         BEGIN
>                 IF NOT newCommand             
<<- Error starts here
>                         BEGIN
>                                 select rtrim(fy) as fy
FROM
>                                 (
>                                 select 'X' as fy
>                                         union all
>                                         select fy from
[dbo].[lu_fy] with
> (nolock)
>                                 ) x
>                                 order by isnumeric(fy)
>                         END
>                 ELSE
>                         BEGIN
>                                 SELECT DISTINCT [fy]
>                                 FROM [dbo].FC_FY WITH
(NOLOCK)
>                                 WHERE [fy] IN (SELECT
[fy] from [dbo].
> [LU_FY] WHERE [currency] = 'CURRENT')
>                                 ORDER BY [fy]
>                         END
>         END
>
>
> Msg 4145, Level 15, State 1, Procedure
p_FC_GET_APC_EDIT_FILTER, Line 22
> An expression of non-boolean type specified in a
context where a condition
>
> is expected, near 'BEGIN'.
> Msg 156, Level 15, State 1, Procedure
p_FC_GET_APC_EDIT_FILTER, Line 31
> Incorrect syntax near the keyword 'ELSE'.
>
> Thanks in advance!
>
>
> Jim MacDiarmid
> CACI
> 4795 Meadow Wood Lane
> Chantilly, VA. 20151-2222
> Voice (703) 679-5454
>
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com
>
>
>
>
>
> Need SQL Advice? http://sqladvice.com
> Need RegEx Advice? http://regexadvice.com
> Need XML Advice? http://xmladvice.com



Need SQL Advice? http://sqladvice.com
Need RegEx Advice? http://regexadvice.com
Need XML Advice? http://xmladvice.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )