# Error reverse engineering a MS SQL Serer 2005 database

**URL:** <https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115>\
**Category:** Toad Data Modeler\
**Created:** [November 15, 2009, 8:50am UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115 "2009-11-15T08:50:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommartens](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@tommartens](https://forums.toadworld.com/u/tommartens)\
**Post date:** [November 15, 2009, 8:50am UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115/1 "2009-11-15T08:50:36Z")

</div>

Hello,

I’m trying to reverse engineer a MS SQL Server 2005 database but I’m getting the following error:

Incorrect type of 1. parameter.

Function FindUserObjectByREID(AREID: widestring)  
Expected parameter type: widestring  
Obtained parameter type: unknown

The description is:

Script: REDataMigratorDBMS05  
Description: Incorrect type of 1. parameter.

Function FindUserObjectByREID(AREID: widestring)  
Expected parameter type: widestring  
Obtained parameter type: unknown

Row: 4138  
Column: 5

Callstack:  
“REDataMigratorDBMS05” from package “Object RE Database for MS SQL 2005”

What’s wrong…  
Any hint is very much appreciated.

Tom

---

<div class="post-metadata">

**Author:** ![vladka](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vladka/32/41_2.png) [@vladka](https://forums.toadworld.com/u/vladka)\
**Post date:** [November 15, 2009, 1:56pm UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115/2 "2009-11-15T13:56:47Z")

</div>

Hi Tom,

Please write us what TDM version you use. Thanks.

Regards,

Vladka

---

<div class="post-metadata">

**Author:** ![tommartens](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@tommartens](https://forums.toadworld.com/u/tommartens)\
**Post date:** [November 16, 2009, 2:44am UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115/3 "2009-11-16T02:44:58Z")

</div>

Hello,

I’m using Toad Data Modeler Version 3.4.15.10 (Eval-Edition)

My SQL Server is running as a default instance the version is 9.00.4035.00 SP3 Developer Edition.

Hope this helps

Tom

---

<div class="post-metadata">

**Author:** ![vladka](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vladka/32/41_2.png) [@vladka](https://forums.toadworld.com/u/vladka)\
**Post date:** [November 18, 2009, 5:20am UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115/4 "2009-11-18T05:20:42Z")

</div>

Hi Tom,

I’m afraid, we need to ask you for the following additional information:

- ADO provider you use for the RE
- what is the last message in the Log area (Message Explorer) before the error occurs.

Thanks for the details.

Regards,

Vladka + TDM Team

---

<div class="post-metadata">

**Author:** ![tommartens](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@tommartens](https://forums.toadworld.com/u/tommartens)\
**Post date:** [November 18, 2009, 1:22pm UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115/5 "2009-11-18T13:22:29Z")

</div>

Hello Vladka,

I’m not sure if I get you right,

maybe this will help

-ADO provider  
here is the connection string:

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=developeandtesting;Data Source=cw175

If I’m testing the specified connection string, I get the message: Connection was succesful.

I don’t know how to get the version of the SQLOLEDB provider

-last message from the log area (I paste all the messages)  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* here come the messages  
274 | 18.11.2009 19:56:57 | Connecting to database. | | 1002 | 1 | 4244| 28  
275 | 18.11.2009 19:56:57 | Reversing default objects… | | 1002 | 1 | 4244| 28  
276 | 18.11.2009 19:56:57 | Reversing rule objects… | | 1002 | 1 | 4244| 28  
277 | 18.11.2009 19:56:57 | Reversing alias data types / user-defined types | | 1002 | 1 | 4244| 28  
278 | 18.11.2009 19:56:57 | Reversing columns… | | 1002 | 1 | 4244| 28  
279 | 18.11.2009 19:56:58 | Reversing primary keys… | | 1002 | 1 | 4244| 28  
280 | 18.11.2009 19:56:58 | Reversing alternate keys… | | 1002 | 1 | 4244| 28  
281 | 18.11.2009 19:56:58 | Incorrect type of 1. parameter.

Function FindUserObjectByREID(AREID: widestring)  
Expected parameter type: widestring  
Obtained parameter type: unknown | Source: Incorrect type of 1. parameter.

Function FindUserObjectByREID(AREID: widestring)  
Expected parameter type: widestring  
Obtained parameter type: unknown  
Script: REDataMigratorDBMS05  
Description: Incorrect type of 1. parameter.

Function FindUserObjectByREID(AREID: widestring)  
Expected parameter type: widestring  
Obtained parameter type: unknown

Row: 4138  
Column: 5

Callstack:  
“REDataMigratorDBMS05” from package “Object RE Database for MS SQL 2005”  
| 1005 | 4 | 4244| 0  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* here end the messages

For your interest the error only appears if I select the option “Load unique Constraints”. I don’t know how to check this on my database.

Kind regards

Tom

---

<div class="post-metadata">

**Author:** ![vladka](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vladka/32/41_2.png) [@vladka](https://forums.toadworld.com/u/vladka)\
**Post date:** [November 19, 2009, 4:53am UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115/6 "2009-11-19T04:53:11Z")

</div>

Hello Tom,

Thanks for the details.

We have found out the error occurs during searching in which partition scheme or filegroup the currently loaded unique constraint is.  
In any case, it’s a mystery for us why the problem occurs.  
We’re afraid, we will need your assistance.

Please check out the Private Messages section for my message.

Thanks in advance for your co-operation.

Regards,

Vladka

---

<div class="post-metadata">

**Author:** ![tommartens](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@tommartens](https://forums.toadworld.com/u/tommartens)\
**Post date:** [November 20, 2009, 3:33pm UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115/7 "2009-11-20T15:33:49Z")

</div>

Hello Vladka,

you have eMail.

Kind regards

Tom

Message was edited by: tommartens

---

<div class="post-metadata">

**Author:** ![vladka](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vladka/32/41_2.png) [@vladka](https://forums.toadworld.com/u/vladka)\
**Post date:** [November 24, 2009, 1:16am UTC](https://forums.toadworld.com/t/error-reverse-engineering-a-ms-sql-serer-2005-database/2115/8 "2009-11-24T01:16:49Z")

</div>

Hello all,

Here’s a quick summary of what we found.  
Problem 1: Problem that Tom encountered. The problem occurs during searching in which partition scheme or filegroup the currently loaded unique constraint is.  
CR 68 959

Problem 2:  
This part of code of function  
…  
UNIQUE CLUSTERED(lvl, n) – Index will be used to filter lvl  
)

was loaded as  
…  
UNIQUE CLUSTERED(lvl, n) – Index will be used to filter lvl )

Which is not correct, because the ending parenthesis ")“ is considered as part of comment. In current TDM version you can solve this problem this way: in the RE Wizard select the "Load Some Objects as SQL Sentence Only“ checkbox.

This problem has been registered under CR 68 961.

I’m happy to inform you that both problems were already fixed and the fixes will be available in next TDM version.  
Note: The fixes were done also for MS SQL 2008.

A big ‘Thank you’ goes to Tom. Tom, thanks for your great co-operation!

Regards,

Vladka + TDM Team
