[FIXED] SqlDbType.Text length 16?

Posts   
 
    
Posts: 5
Joined: 08-Mar-2004
# Posted on: 08-Mar-2004 22:25:35   

I have an entity with a Sql Server 7 TEXT field (SqlDbType.Text), but the generated code is setting a length of 16 on that field.

Anyone know how to work-around this, or what I'm doing wrong?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 08-Mar-2004 23:33:24   

I've seen this error report before via email. I'll get back to you what the results were. It's a bug in SqlServer's views but you're of course interested in how to solve it simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 09-Mar-2004 09:54:36   

Bug was reported before, however user had fixed it himself.

I'll file a bug here so it gets fixed a.s.a.p. I'll mail you a fixed dll when it is done, approx. later today.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 5
Joined: 08-Mar-2004
# Posted on: 09-Mar-2004 21:09:02   

Other pertinent info...It's not a view, just a regular old table in Sql Server 7. I wonder if that's it (SQL7). Here's some sql to create the table:

CREATE TABLE [WorkArea] ( [WaId] [int] IDENTITY (1, 1) NOT NULL , [ImportFilename] [varchar] (255) NOT NULL , [ImportDate] [datetime] NOT NULL , [Status] [int] NOT NULL , [Comments] [text] NOT NULL , CONSTRAINT [PK_WorkArea] PRIMARY KEY CLUSTERED ( [WaId] ) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 09-Mar-2004 21:18:03   

No, it's the logic I use to retrieve type info. This logic is basic recommended logic by MS how to retrieve type info of fields. In Sqlserver 2000, a text field will report a length of 2GB. In Sqlserver 7 it will report 16 simple_smile

I tried to setup a sqlserver 7 testbox today, haven't succeeded in that completely, so I'll try tomorrow again.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 10-Mar-2004 18:18:46   

Well, my win2k advanced server testbox is completely dead now after sqlserver 7's SP4 installation (it will boot, but networking dies). Something has been overwritten which shouldn't have. I'll now try to re-install win2ksp4, perhaps that will re-incarnate the box, and I can work on the fix, otherwise I have to repair the install, which will take even longer... rage

Frans Bouma | Lead developer LLBLGen Pro
bertcord avatar
bertcord
User
Posts: 206
Joined: 01-Dec-2003
# Posted on: 10-Mar-2004 19:47:26   

thats sucks...

you need to get wmware to help you with testing

www.vmware.com

bert

Posts: 5
Joined: 08-Mar-2004
# Posted on: 10-Mar-2004 20:39:02   

Dang, that really sucks. It really couldn't happen to a nice and more helpful person.

Wish I could do something to help...I could send you a beer via FedEx or something. What's your poison?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 11-Mar-2004 09:39:42   

simple_smile Thanks for the morale support guys simple_smile

After uninstalling SP4 and SqlServer, then re-installing SP4 for win2k, the box at least works. I think I first create a system backup before applying sp4 of sqlserver 7 again. simple_smile .

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 11-Mar-2004 14:42:25   

Ok!

After a lot of erm... not so nasty words, I found out that having Oracle AND Sqlserver 7 running on the same box means no functional named pipe functionality and other nasties (corrupt network stack etc.)

So I shut down the oracle processes and managed to get sqlserver 7 running.

I found out that the INFORMATION_SCHEMA views in sqlserver 7 are very buggy. For example they report the CHARACTER_MAXIMUM_LENGTH and the CHARACTER_OCTET_LENGTH wrong (they confused the columns). So an nvarchar(40) has a maxlength of 20 and an octet length of 40. In SqlServer 2000 this is correct, however in sqlserver 7 maximum length is 40 and octet length is 20. smile

So I defined a new column which uses COLUMNPROPERTY() and which reports the correct length. This is also fixed for views. Stored procedures were already ok as I had to use OleDb to retrieve those on SqlServer 7.

I'll now check if the code reports the same on sqlserver 2000 and will release a hotfix for the sqlserver driver.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 11-Mar-2004 15:00:04   

The hotfix is available. Check the Database drivers section in the customer area simple_smile

Frans Bouma | Lead developer LLBLGen Pro
OddurMag avatar
OddurMag
User
Posts: 17
Joined: 21-Oct-2003
# Posted on: 11-Mar-2004 15:03:23   

You really should set up VirtualPC 2004 for testing, it rocks !

You could have a linux with oracle, sql 2000, sql 7, yukon (!) e.t.c. all setup on the same box !

netclectic avatar
netclectic
User
Posts: 255
Joined: 28-Jan-2004
# Posted on: 11-Mar-2004 16:39:32   

Not seen VirtualPC, i use VMWare for such testing.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 11-Mar-2004 16:53:47   

VirtualPC 2004 is from MS, right? Heard good things about it indeed.

I've a box here with a lot of partitions, I boot what I need for testing so that's ok, the problem with the oracle - sqlserver love was one I hadn't foreseen. Most of the time testing is pretty smooth. BUt I'll keep it in mind once I can get my hands on Virtual PC simple_smile

Frans Bouma | Lead developer LLBLGen Pro
OddurMag avatar
OddurMag
User
Posts: 17
Joined: 21-Oct-2003
# Posted on: 12-Mar-2004 18:35:05   

Frans, don't you have a MSDN subscription, at least we got with out universal subscription.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 12-Mar-2004 21:32:54   

OddurMag wrote:

Frans, don't you have a MSDN subscription, at least we got with out universal subscription.

No. I had one in 2002. But because there wasn't a lot of new stuff coming out in 2003 I didn't renew it. I was planning to renew it so I could grab yukon and whidbey for a low price, but as these are delayed till next year, I'll wait for a while simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39898
Joined: 17-Aug-2003
# Posted on: 19-Mar-2004 21:01:46   

The fix for the issue of the Topic Starter is now available.

Frans Bouma | Lead developer LLBLGen Pro