[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 79
  • Last Modified:

Size defined in Excel VBA

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
AXISHK
Asked:
AXISHK
1 Solution
 
SimonCommented:
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now