Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

longtext Expand / Collapse
Author
Message
Posted Wednesday, October 30, 2013 11:03 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 8:24 AM
Points: 61, Visits: 386
Howdy everybody,

I want to keep 11321 character in field on table SQL Server, but varchar(max) is not allow...

It's because i'm doing a database migration MySQL to SQL Server and i need a big field (similar bigtext)
Post #1509880
Posted Wednesday, October 30, 2013 11:15 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 2:28 PM
Points: 33,062, Visits: 15,174
varchar(max) should allow 2GB of space. Are you sure this is what the field is set to? How are you determining the 11kb will not fit?

This works:
create table mytest (mychar varchar(max));

insert into mytest select replicate( cast( 'A' as varchar(max)), 11000);


Note there are issue with implicit conversions. http://stackoverflow.com/questions/9172516/how-to-run-a-more-than-8000-characters-sql-statement-from-a-variable







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1509884
Posted Wednesday, October 30, 2013 11:40 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 8:24 AM
Points: 61, Visits: 386
but the problem is openrowset

Msg 103, Level 15, State 1, Line 4
The character string that starts with 'select `ID`,if(`STATUS`='',null,`STATUS`) as `STATUS`,if(`DIGITADOR`='',null,`DIGITADOR`) as `DIGITADOR`,if(`DATA_INCLUSAO`='',nu' is too long. Maximum length is 8000.

is the big problem..
Post #1509898
Posted Wednesday, October 30, 2013 11:55 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 8:24 AM
Points: 61, Visits: 386
I've this problem: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/7a5c76c5-e6f3-49c7-9c52-95935d7530fd/the-character-string-that-starts-with-is-too-long-maximum-length-is-8000?forum=sqlreportingservices
Post #1509902
Posted Wednesday, October 30, 2013 12:56 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 1:36 PM
Points: 2,514, Visits: 3,705
Read the info on this page about OPENROWSET:

http://technet.microsoft.com/en-us/library/ms190312.aspx

A little over half way down it describes how it handles data exceeding 8,000 bytes using an XML format file.

Tom
Post #1509912
Posted Wednesday, October 30, 2013 3:54 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 12:14 AM
Points: 36,735, Visits: 31,186
I don't know if it's appropriate here or not but I find that a lot of people use OPENROWSET as a defacto standard for a lot of things where something like OPENQUERY might be much more appropriate especially since OPENQUERY doesn't require "SA" privs like OPENROWSET does.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1509967
Posted Wednesday, October 30, 2013 4:15 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 8:24 AM
Points: 61, Visits: 386
Jeff, my problem is maximum size 8... I was tried using SSIS, but it's the same problem... I have a 180 columns and 1 million rows (MySQL).... when I show all columns in varchar (after transformation, data type, etc), I have 13421 character, and the maximum is 8... it's the big problem.
Post #1509974
Posted Wednesday, October 30, 2013 6:09 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 12:14 AM
Points: 36,735, Visits: 31,186
LOVER OF SQL (10/30/2013)
Jeff, my problem is maximum size 8... I was tried using SSIS, but it's the same problem... I have a 180 columns and 1 million rows (MySQL).... when I show all columns in varchar (after transformation, data type, etc), I have 13421 character, and the maximum is 8... it's the big problem.


Even SQL Server has such a display problem (although I don't know why you would want to ever display a million rows on screen). I don't know much about MySQL (for example, I don't even know if MySQL has a VARCHAR(MAX) datatype), but would something like the following do it for you (works in SQL Server and seems to be part of the XML standard).

SELECT  @LongString AS [processing-instruction(LongString)]
FOR XML PATH(''), TYPE;



--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1509988
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse