How do I use this?

Sep 18, 2009 at 3:20 PM

 

 

 

ss

 

DECLARE @return_value int,

@resultMsg nvarchar(max)
EXEC @return_value = [dbo].[InsertListItems]
@tableName = N'tblJasons',
@webUrl = N'http://mossdemo/_vti_bin/Lists.asmx',
@listName = N'Jasons',
@folderPath = null,
@batchSize = 300,
@resultMsg = @resultMsg OUTPUT
SELECT @resultMsg as N'@resultMsg'
SELECT 'Return Value' = @return_valueHi Hi
Hi, I keep getting the error:
Failure: SharePoint list schema doesn't match with table schema (Column Name, Column Data Type, Allow Nulls).
I have a SharePoint list that has the following columns: Title (required), Created by and Modified By. I created the equivalent table in SQL Server. I used the column types as described in the field types mapping in the documentation. I call the SP with:
DECLARE @return_value int,
@resultMsg nvarchar(max)
EXEC @return_value = [dbo].[InsertListItems]
@tableName = N'tblTes',
@webUrl = N'http://demoserver/_vti_bin/Lists.asmx',
@listName = N'TestList',
@folderPath = null,
@batchSize = 300,
@resultMsg = @resultMsg OUTPUT
SELECT @resultMsg as N'@resultMsg'
SELECT 'Return Value' = @return_value
The return value is 0.
Thanks.

 

Sep 21, 2009 at 2:24 AM

If I'd read the documentation right to the end I'd have noticed that I don't need to include the Created By and Modified By columns. It works, thanks.