Hi,
I encounter a strange problem.Here down,I explain it.Pls anyone give me
solution.
typeID is of INT type
In a storedprocedure,when used as
typeID='+cast(23 as varchar)+'
it is getting executed but when i break the stored procedure,it is
showing error
as below:
Syntax error converting the varchar value '+CAST(23 AS VARCHAR)+' to a
column of data type int.
Thanks
SunilDutt N.
Dutt
INT is highest in terms of Data Type Precedence, thuis you 've got a error.
SQL Server tries to convert a varachar (lower) to INT (higher)
"Dutt" <Mr.Dutt@.gmail.com> wrote in message
news:1165930651.040999.302700@.16g2000cwy.googlegro ups.com...
> Hi,
> I encounter a strange problem.Here down,I explain it.Pls anyone give me
> solution.
> typeID is of INT type
> In a storedprocedure,when used as
>
> typeID='+cast(23 as varchar)+'
>
> it is getting executed but when i break the stored procedure,it is
> showing error
> as below:
> Syntax error converting the varchar value '+CAST(23 AS VARCHAR)+' to a
> column of data type int.
> Thanks
> SunilDutt N.
>
|||Uri,
But,its working in the sp.
Thanks
Dutt
Uri Dimant wrote:[vbcol=seagreen]
> Dutt
> INT is highest in terms of Data Type Precedence, thuis you 've got a error.
> SQL Server tries to convert a varachar (lower) to INT (higher)
>
>
> "Dutt" <Mr.Dutt@.gmail.com> wrote in message
> news:1165930651.040999.302700@.16g2000cwy.googlegro ups.com...
|||Dutt
Can you show us entire source?
"Dutt" <Mr.Dutt@.gmail.com> wrote in message
news:1165931759.413557.54020@.73g2000cwn.googlegrou ps.com...
> Uri,
> But,its working in the sp.
> Thanks
> Dutt
> Uri Dimant wrote:
>
|||Hi Uri,
I got it.
It was a dynamic SQL statement with a lot of quotes which bring
confusion.
Thanq.
Dutt.
Uri Dimant wrote:[vbcol=seagreen]
> Dutt
> Can you show us entire source?
>
> "Dutt" <Mr.Dutt@.gmail.com> wrote in message
> news:1165931759.413557.54020@.73g2000cwn.googlegrou ps.com...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment