?
Solved

Size defined in Excel VBA

Posted on 2015-01-22
1
Medium Priority
?
77 Views
Last Modified: 2015-02-08
In case the SQL Stored procedure input parameter is defined as NVARCHAR(MAX). How can I define the parameter in Excel VBA.

cmd.Parameters.Append cmd.CreateParameter("INVENTBATCHID", adVarChar, adParamInput, xxxx, stPar1)
0
Comment
Question by:AXISHK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
Simon earned 2000 total points
ID: 40565918
Although the stored proc will accept a huge chunk of text (up to 2GB), you can be more restrictive if you don't need to pass a very long value. It makes sense to restrict it if INVENTBATCHID is only intended to be a short string.

adLongVarWChar is the closest matching datatype
but you could use
adVarWChar for unicode text <4000 chars

See also the datatype enumeration reference
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question