Tuesday, August 29, 2017

LS One - Failed to insert. Could not connect to Site Service.

Confirm that the table schema in the company database matches the schema in the Audit database.
Modify the Audit database if necessary.

You may also get a "Could not connect to Site Service" error if there are any errors in the schema

Use this script to identify and update all fields to the correct schema.
Update the FScript and c.name where necessary




SELECT      c.name  AS 'ColumnName'
            ,t.name AS 'TableName','alter table test_audit.dbo.' + t.name + ' alter column ITEMID nvarchar(30) not null' as FScript
FROM        sys.columns c
JOIN        sys.tables  t   ON c.object_id = t.object_id
WHERE       c.name = 'ITEMID'
ORDER BY    TableName
            ,ColumnName;


                     SELECT      c.name  AS 'ColumnName'
            ,t.name AS 'TableName','alter table test.dbo.' + t.name + ' alter column ITEMID nvarchar(30) not null' as FScript
FROM        sys.columns c
JOIN        sys.tables  t   ON c.object_id = t.object_id
WHERE       c.name = 'ITEMID'
ORDER BY    TableName
            ,ColumnName;

No comments:

Post a Comment