VarChar(max), VarBinary(max) con SQL Server 2005 ed il valore di SqlDbType

Daniele Bochicchio

di , in .NET Framework,

Stavo lavorando con VarChar(max), che è una nuova funzionalità di SQL Server 2005 che manda in pensione, in certi contesti, Text, NText e compagnia bella, suggeritami da Andrea Montanari, MVP per la Piadina (come la fa lui, ragazzi, non l'ho ancora trovata) :)

Divagazioni a parte, il succo del problema era come fare ad usare da codice questo nuovo data type, dato che non c'era un valore nell'enum SqlDataType ad hoc. La risposta è in questa pagina della documentazione, tutt'altro che facile da trovare, e consiste nell'aggiungere come valore della dimensione un bel -1, altrimenti, ovviamente, viene presa la dimensione del valore, che comunque per VarChar non superebbe gli 8 mila char.

Me n'ero dimenticato, non avendo usato finora in maniera intensiva SQL Server 2005, è utilissima come funzionalità per sostituire Text!

Commenti
VarChar(max), VarBinary(max) con SQL Server 2005 ed il valore di SqlDbType

Per inserire un commento, devi avere un account.

Fai il login e torna a questa pagina, oppure registrati alla nostra community.

Nella stessa categoria
I più letti del mese
TAG CLOUD
.NET Framework, .NET Framework 2.0, .NET Framework 3.0, .NET Framework 3.5, .NET Framework 4.0, .NET Framework 4.5, .NET Micro Framework, 10annidi, ADO.NET, AJAX, Architettura, ASP, ASP.NET, ASP.NET 2.0, ASP.NET 2.0 per tutti, ASP.NET 3.5, ASP.NET 3.5 per tutti, ASP.NET 4.0, ASP.NET 4.0 Guida completa, ASP.NET 4.5, ASP.NET AJAX, ASP.NET Charting, ASP.NET MVC, ASPItalia.com, C# 4 Guida completa, Cache, Community Days 2010, Community Days 2012, CSS, Custom Control, Database, Databinding, Datagrid, Deployment, Dynamic Data Control, Entity Framework, Expression Blend, HTML 5 Espresso, HTML5, HttpHandler, HttpModule, HttpRuntime, IIS, ISAPI, Javascript, jQuery, LINQ, LINQ to Entities, LINQ to SQL, LogParser, Master Pages, Media Center, Membership API, Metro, Microsoft Expression, MIX11, Model Virtual Casting, Mono, MySQL, Object Oriented Programming, Off Topic, Office, ORM, Parallel FX, Pattern, PDC 2008, Profile API, Provider Model, Real Code Day 6, Report, Roles API, Security, SEO, Silverlight, Silverlight 2.0, Silverlight 3.0, Silverlight 3.0 Guida Completa, Silverlight 4.0, SQL Server, User Control, Visual Basic 2010 Guida completa, Visual Studio, Visual Studio 11, WCF Data Services, WCF RIA Services, Web Service, web.config, Windows 7, Windows 8, Windows Azure, Windows Client, Windows Communication Foundation, Windows Identity Foundation, Windows Live Services, Windows Phone, Windows Phone - il libro, Windows Phone 7, Windows Phone 7.1, Windows Phone 7.1.1, Windows Presentation Foundation, Windows Server, Windows Vista, WinRT, XAML, XBox 360, XHTML, XML, XNA, XSLT
BLOG INFO
  • 1.034 post, 442 commenti, 196 trackback
  • Feed blog: RSS Atom
In evidenza