Home All Groups Group Topic Archive Search About
Author
13 Sep 2006 10:25 PM
tshad
I have a stored procedure that works fine.

I take the code and move it to Query analyser and I get a message saying my
Variable is too long.
********************************************************
Declare @FromDate DateTime,
@ToDate DateTime,
@Sql VarChar(8000)

Select @FromDate = '09-13-06',@ToDate = '09-13-06'
Select @Sql = "
Select HistoryLogID,SessionID,hl.UserID,p.CompanyID,hl.ApplicantID,
**********************************************************

Server: Msg 103, Level 15, State 7, Line 6
The identifier that starts with '
Select HistoryLogID,SessionID,hl.UserID,p.CompanyID,hl.ApplicantID,
  HistoryFullName=hl.FirstName + ' ' + hl.LastName,Histo' is too long.
Maximum length is 128.

It is talking about @Sql (I assume).

Is this a limitation of Query Analyser?

Thanks,

Tom

Author
13 Sep 2006 11:19 PM
Hari Prasad
Hi,

Can you please post the contents of entire stored procedure?

Thanks
Hari
SQL Server MVP

Show quote
"tshad" wrote:

> I have a stored procedure that works fine.
>
> I take the code and move it to Query analyser and I get a message saying my
> Variable is too long.
> ********************************************************
> Declare @FromDate DateTime,
>  @ToDate DateTime,
>  @Sql VarChar(8000)
>
> Select @FromDate = '09-13-06',@ToDate = '09-13-06'
> Select @Sql = "
>  Select HistoryLogID,SessionID,hl.UserID,p.CompanyID,hl.ApplicantID,
> **********************************************************
>
> Server: Msg 103, Level 15, State 7, Line 6
> The identifier that starts with '
>  Select HistoryLogID,SessionID,hl.UserID,p.CompanyID,hl.ApplicantID,
>   HistoryFullName=hl.FirstName + ' ' + hl.LastName,Histo' is too long.
> Maximum length is 128.
>
> It is talking about @Sql (I assume).
>
> Is this a limitation of Query Analyser?
>
> Thanks,
>
> Tom
>
>
>
Author
14 Sep 2006 6:35 AM
ML
Are you perhaps using double quotes to enclose strings? Use single quotes.

More info here:
http://msdn2.microsoft.com/en-us/library/ms174393.aspx


ML

---
http://milambda.blogspot.com/

AddThis Social Bookmark Button