SYMPTOMS
When you use xp_cmdshell to return results through the INSERT INTO EXECUTE
Transact-SQL statement, and the results that are returned contain NULL
values, and the table definition specifies a NOT NULL constraint, you may
receive the following errors:
Msg 515, Level 16, State 3
Attempt to insert the value NULL into column 'strInfo', table
'tempdb.dbo.#tblBugs2___________0000000040';
column does not allow nulls. INSERT fails.
Msg 3601, Level 25, State 1
Stored function 'xp_cmdshell' in the library 'xpsql60.dll' generated
access violation; SQL Server is terminating process 10
These errors occur only if all of the following conditions are true:
- You have more than one NULL value in a row being returned.
- The table does not allow NULL values.
- Xp_cmdshell returns the values to an INSERT INTO EXECUTE statement.