passing Nulls to SQL Server 2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some stored procedures in a SQL Server 2005 database to which I pass
Excel data by way of VBA. These sprocs have parameters, some of which are
expecting strings from cells in text-type columns in Excel - these are then
passed to database fields of type varchar or nvarchar. This code currently
falls over if one of these cells has nothing in it. Does anyone know of a
way in Excel/VBA that I can pass nulls successfully to text fields in SQL
Server? Perhaps some VBA constant I haven't heard of.

(I know I can deal with it in the stored procedures by setting defaults of
null and then using If conditions but this seems unnecessarily
overcomplicated.)
 
Thanks Vergel but those don't seem to work. I'm currently working around it
by passing a space " " for empty cells but it seems a bit clumsy!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top