sqlines icon indicating copy to clipboard operation
sqlines copied to clipboard

Oracle to MSSQL 2016: Failed to create extended property

Open ChaosBladeCoder opened this issue 7 years ago • 1 comments

I'm trying to migrate an entire Oracle database to SQL Server, and I'm running into several issues. I will log them separately here.

I'm trying to migrate an Oracle table which has a COMMENT on it, like:

COMMENT ON TABLE MyUser.MyTable IS 'This is my comment';

Migrating this table fails when it tries to convert the comment. The error is "Object is invalid. Extended properties are not permitted on 'MyUser.MyTable', or the object does not exist".

The failing SQL that SQLines generated is:

EXECUTE sp_addextendedproperty 'Comment', 'This is my comment', 'user', MyUser, 'table', [MyTable];

The string 'user' in this command is wrong, and should be changed to 'schema' to make it work:

EXECUTE sp_addextendedproperty 'Comment', 'This is my comment', 'schema', MyUser, 'table', [MyTable];

ChaosBladeCoder avatar Oct 31 '17 19:10 ChaosBladeCoder

The same error happens with the conversion of comments on columns. This gets rendered as:

EXECUTE sp_addextendedproperty 'Comment', 'This is my comment', 'user', MyUser, 'table', [MyTable], 'column', MyColumn;

Again 'user' should be changed to 'schema' here.

ChaosBladeCoder avatar Nov 01 '17 10:11 ChaosBladeCoder