Home All Groups Group Topic Archive Search About
Author
15 Mar 2007 6:55 PM
DWC
I ran into an issue with varcharmax and I was wondering if anyone knows
about this

If you look at a file exported from sql mgmt studio it exports the line in
the create statement for a varcharmax field as
    [news] [varchar] (-1)

But if you try to run that in query analyzer it causes an error.  You have
to use


    [news] [varchar] (MAX)

Is this a bug?

Author
19 Mar 2007 10:37 PM
Kevin G. Boles
Not a bug - a 'feature'!!  :-))

Sounds like a bug to me, either in SSMS or in the API/code used to do the
scripting (SMO??).  At least you can do a text replacement to get (max)
where you need it though.

--
TheSQLGuru


Show quote
"DWC" <D**@discussions.microsoft.com> wrote in message
news:984C20A4-1808-43DE-AEAB-660362AF0CD0@microsoft.com...
>
> I ran into an issue with varcharmax and I was wondering if anyone knows
> about this
>
> If you look at a file exported from sql mgmt studio it exports the line in
> the create statement for a varcharmax field as
> [news] [varchar] (-1)
>
> But if you try to run that in query analyzer it causes an error.  You have
> to use
>
>
> [news] [varchar] (MAX)
>
> Is this a bug?
Author
20 Mar 2007 12:19 AM
Sue Hoegemeier
I just ran a few and couldn't reproduce - but I'm not
following how you did this.
What are the steps to reproduce the issue? What file are you
exporting from where with the create statement? What service
pack are you running?

-Sue

On Thu, 15 Mar 2007 11:55:10 -0700, DWC
<D**@discussions.microsoft.com> wrote:

Show quote
>
>I ran into an issue with varcharmax and I was wondering if anyone knows
>about this
>
>If you look at a file exported from sql mgmt studio it exports the line in
>the create statement for a varcharmax field as
>    [news] [varchar] (-1)
>
>But if you try to run that in query analyzer it causes an error.  You have
>to use
>
>
>    [news] [varchar] (MAX)
>
>Is this a bug?
Author
20 Mar 2007 12:35 PM
Aaron Bertrand [SQL Server MVP]
> If you look at a file exported from sql mgmt studio it exports the line in
> the create statement for a varcharmax field as
> [news] [varchar] (-1)

Ooh, nice one.  I knew one of these would slip through.

Can you detail how you created this export file?

AddThis Social Bookmark Button