Avatar of mlcktmguy
mlcktmguy
Flag for United States of America asked on

Passing and nvarchar(Max) parameter form Access 2013 to a SQL Server SPROC?

I am writing a routine in my Access 2013 front end that calls a SPROC on SQL Server.  One of the params is a user comment that is defined as nvarchar(max) on the SQl side.

I have written access routines that call SPROCS, passing string variables but they are of a defined length.  A param statement passing to a field defined as nvarchar(30) in SQL looks like this:

    Set param6 = .CreateParameter("passedUserName", adVarChar, adParamInput, 30, passedUserName)
    .Parameters.Append param6

Open in new window


What would the syntax be when passing a param defined a nvarchar(max) in the SPROC?

I'm temporarily using
    Set param6 = .CreateParameter("passedUserName", adVarChar, adParamInput, 1000 , passedUserName)
    .Parameters.Append param6

Open in new window

but that has a fixed length of 1000.
Microsoft AccessMicrosoft SQL ServerSQL

Avatar of undefined
Last Comment
Mark Wills

8/22/2022 - Mon
Kelvin Sparks

Pass it as if it was the old nText datatype in SQL (a guess) Access 2013 doesn't understand or recognise the varchar(max) datatype.

Kelvin
ASKER CERTIFIED SOLUTION
Mark Wills

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy