varcharmax

Why not use varchar(max)?

…衆ロ難τιáo~ 提交于 2019-12-17 15:59:13
问题 I'm a bit old school when it comes to database design, so I'm totally for using the correct data sizes in columns. However, when reviewing a database for a friend, I noticed he used varchar(max) a lot. Now, my immediate thought was to throw it back to him and tell him to change it. But then I thought about it and couldn't come up with a good reason for him not to use it (he'd used a case type tool to generate the db, if you're wondering). I've been researching the topic of varchar(max) usage

SSMS and sp_OAMethod: is there a Data Type greater than VARCHAR(8000)?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 15:56:17
问题 Calling a REST service through SSMS is indeed not a great idea. BTW since Microsoft created the Stored Procedure sp_OAMethod and even Phil Factor from Red Gate show us how to use it I wanted to give it a go. I wanted to import some data from OpenStreetMap directly into MSSQL, so I copy a good query from here and I adapt it to my whish. In this example I'm returning all Cinemas in Nelson : DECLARE @obj AS INT DECLARE @Uri AS NVARCHAR(4000) DECLARE @Response AS VARCHAR(8000) SET @Uri = 'http:/

Can't read data from varchar(max) using ADODB

回眸只為那壹抹淺笑 提交于 2019-12-11 03:16:14
问题 I've got a method that uses ADODB to execute a sproc and read the results as a recordset. Everything was working fine until i changed one of the output fields from varchar(2000) to varchar(max) (SQL2008). Now I can't read the data from that field. The strange thing is that the data is visible in the debugger immediately after running the Execute, but stepping in the debugger makes the data vanish. Here is the code: Public Function sproc_RptEAComment(ByVal accountName As String, ByVal

Returning varchar(max) Output parameter from stored procedure truncating to 4000 characters

三世轮回 提交于 2019-12-10 19:23:32
问题 I've got a classic ASP appln with a SQL2012 database. I recently changed a table column from varchar(8000) to varchar(max) as it wasn't big enough to store the required data. I can update the column with all of the data I need to store, but the SP I use to return the column data as an output parameter is only returning 4000 characters (at least that is what the result of the following code is giving me: Len(cmd.Parameters("@detail").Value) I'm using the following parameter declaration as part

SQL 2008 - varchar(max) vs text data types [duplicate]

。_饼干妹妹 提交于 2019-12-09 17:56:34
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: SQL Server Text type vs. varchar data type Using varchar(MAX) vs TEXT on SQL Server from this article, it looks like they both have the same size capacity: http://msdn.microsoft.com/en-us/library/ms143432.aspx is that truly correct? what are the real differences? i just migrated some data from oracle (clob and made it into a varchar(max), but it looks like it truncated some of the values anyway, should i use

SQL 2008 - varchar(max) vs text data types [duplicate]

半世苍凉 提交于 2019-12-04 04:07:04
Possible Duplicate: SQL Server Text type vs. varchar data type Using varchar(MAX) vs TEXT on SQL Server from this article, it looks like they both have the same size capacity: http://msdn.microsoft.com/en-us/library/ms143432.aspx is that truly correct? what are the real differences? i just migrated some data from oracle (clob and made it into a varchar(max), but it looks like it truncated some of the values anyway, should i use TEXT instead? Thank you! No, you should not use TEXT . For one, it has been deprecated since SQL Server 2005 , and also you will find that many string operations do not

How can I insert more than 8000 characters in a VARCHAR(MAX) column with ExecuteNonQuery?

依然范特西╮ 提交于 2019-12-01 10:51:38
I am trying to insert > 8000 characters (submit from a web page) via ExecuteNonQuery (and DatabaseFactory.CreateDatabase() from MS Practices Enterprise Library). The stored procedure defines the parameter as VARCHAR(MAX) . The column is VARCHAR(MAX) . In theory, 2GB of data should be able to be passed. What can I do to pass data > 8000? I set a breakpoint and the string.Length is indeed > 8K. public static void UpdateTerms(string terms) { Database db = DatabaseFactory.CreateDatabase(); db.ExecuteNonQuery("uspUpdateTerms", terms); } Stored procedure: ALTER PROCEDURE [dbo].[uspUpdateTerms]

SQL Server field getting truncated

狂风中的少年 提交于 2019-11-30 20:35:39
Ok I'm using SQL Server 2008 and have a table field of type VARCHAR(MAX) . Problem is that when saving information using Hibernate , the contents of VARCHAR(MAX) field is getting truncated. I don't see any error messages on either the app server or database server. The content of this field is just a plain text file. The size of this text file is 383KB. This is what I have done so far to troubleshoot this problem: Changed the database field from VARCHAR(MAX) to TEXT and same problem occurs. Used the SQL Server Profiler and I noticed that the full text content is being received by the database

SQL Server field getting truncated

孤人 提交于 2019-11-30 03:59:34
问题 Ok I'm using SQL Server 2008 and have a table field of type VARCHAR(MAX) . Problem is that when saving information using Hibernate , the contents of VARCHAR(MAX) field is getting truncated. I don't see any error messages on either the app server or database server. The content of this field is just a plain text file. The size of this text file is 383KB. This is what I have done so far to troubleshoot this problem: Changed the database field from VARCHAR(MAX) to TEXT and same problem occurs.

My VARCHAR(MAX) field is capping itself at 4000; what gives?

你离开我真会死。 提交于 2019-11-29 07:52:12
I have a table in one of my databases which is a queue of emails. Emails to certain addresses get accumulated into one email, which is done by a sproc. In the sproc, I have a table variable which I use to build the accumulated bodies of the emails, and then loop through to send each email. In my table var I have my body column defined as VARCHAR(MAX) , seeing as there could be any number of emails currently accumulated for a given email address. It seems though that even though my column is defined as VARCHAR(MAX) it is behaving as if it were VARCHAR(4000) and is truncating the data going into