dshi15
asked on
Invalid operator for data type. Operator equals boolean AND, type equals varchar.
ALTER Procedure [dbo].[sp_ProcessImage]
@Err int OUTPUT
As
declare @rowPro integer -- 1 row must be Updated
select @Err = 1
Begin Tran
INSERT INTO Asset
( ............
It has error in line
select @Err = 1
said
Invalid operator for data type. Operator equals boolean AND, type equals varchar.
Why?
thanks.
@Err int OUTPUT
As
declare @rowPro integer -- 1 row must be Updated
select @Err = 1
Begin Tran
INSERT INTO Asset
( ............
It has error in line
select @Err = 1
said
Invalid operator for data type. Operator equals boolean AND, type equals varchar.
Why?
thanks.
can u post the complete query
I believe that the actual error is on the previous line. There is no "integer" data type in SQL Server. Change the line to:
declare @rowPro int
declare @rowPro int
ASKER
ALTER Procedure [dbo].[sp_maint_ProcessIma geLibrary]
@Err int OUTPUT
As
declare @rowPro integer -- 1 row must be Updated
select @Err = 1
Begin Tran
INSERT INTO Asset
(
AssetId,
DownloadPath,
PreviewPath,
FSPath,
ToDate,
AssetDesc,
AssetType,
DownloadFile,
PreviewFile,
FSFile,
GraphicColor,
AllPromos,
AllTG,
AllBrands,
Status,
FromDate,
SystemDate,
UID
)
SELECT 'test_' & [OfferGraphics].[AssetName ] AS Expr1,
'https://DOCUMENTS.com/W/' & 'TakeLoadOff' & '/' AS Expr2,
'https://DOCUMENTS.com/W/' & 'TakeLoadOff' & '/Thumbnail/' AS Expr3,
'https://DOCUMENTS.com/W/' & 'TakeLoadOff' & '/Large/' AS Expr4,
'9/15/2007',
OfferGraphics.[AssetDescri ption],
6,
OfferGraphics.[DownloadFil eName],
OfferGraphics.[PreviewFile name],
OfferGraphics.[FSFileName] ,
OfferGraphics.[BW/Color],
'N',
'N',
'N',
'A',
getdate(),
getdate(),
'011sh'
FROM OfferGraphics
select @rowPro = @@rowcount
if @rowPro <> 1 or @@error != 0
begin
Rollback Tran
select @Err = 1
return
end
Commit Tran
select @Err = 0
return
@Err int OUTPUT
As
declare @rowPro integer -- 1 row must be Updated
select @Err = 1
Begin Tran
INSERT INTO Asset
(
AssetId,
DownloadPath,
PreviewPath,
FSPath,
ToDate,
AssetDesc,
AssetType,
DownloadFile,
PreviewFile,
FSFile,
GraphicColor,
AllPromos,
AllTG,
AllBrands,
Status,
FromDate,
SystemDate,
UID
)
SELECT 'test_' & [OfferGraphics].[AssetName
'https://DOCUMENTS.com/W/' & 'TakeLoadOff' & '/' AS Expr2,
'https://DOCUMENTS.com/W/' & 'TakeLoadOff' & '/Thumbnail/' AS Expr3,
'https://DOCUMENTS.com/W/' & 'TakeLoadOff' & '/Large/' AS Expr4,
'9/15/2007',
OfferGraphics.[AssetDescri
6,
OfferGraphics.[DownloadFil
OfferGraphics.[PreviewFile
OfferGraphics.[FSFileName]
OfferGraphics.[BW/Color],
'N',
'N',
'N',
'A',
getdate(),
getdate(),
'011sh'
FROM OfferGraphics
select @rowPro = @@rowcount
if @rowPro <> 1 or @@error != 0
begin
Rollback Tran
select @Err = 1
return
end
Commit Tran
select @Err = 0
return
ASKER
I used declare @rowPro integer in other store procedures, it is fine, never has error.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you very much.
TSQL is not VB. No *integer* data type nor *&* operator. Use *int* and *+* instead...
I suppose that "integer" is some not very well documented alias for "int". You should stick with the normal names for the data types, the ones that everyone else are using.
Also, the != operator is non-standard. You should use the <> operator instead.
Also, the != operator is non-standard. You should use the <> operator instead.