DB Tools VIs do Not Return All Data Correctly Using SELECT with SQL Database

Updated Jun 6, 2018

Reported In

Software

  • LabVIEW
  • LabVIEW Database Connectivity Toolkit

Issue Details

I'm using the DB Tools VIs to query a SQL database.  The data table contains 150 columns of various SQL data types.  When using the DB Tools SELECT function to return data associated with a part number (part number is primary key, returning an entire row with the 150 columns), some of the fields do not return any data.  This only occurs when returning more than one nvarchar(max) datatype.

Solution

If you can limit the characters to 4000, use the nvarchar(4000)(or more generally, nvarchar(n) where 0 < n <= 4000) type instead of nvarchar(max).  You could also query for the specific columns which use nvarchar(max) types, or ensure that you do not try to return two nvarchar(max) types in the same query.

WAS THIS ARTICLE HELPFUL?

Not Helpful