Adding data to database from Microstation

Hi!

 I am trying to attach some attribute information to my dgn elements. Elements with the same info should be connected to the same row in database. Is it the simplest way?:

 Say, DB connection (ODBC to MS SQL Server 2008) set and empty my_table with my_attribute column created.

  1. Settings -> Database -> Dialog. Linkage Mode = New      - table is empty, so we have to populate it with needed data).
  2. Key-in: AE=INSERT INTO my_table (my_attribute,MSLINK) VALUES (90,1)       - I’ve noticed it’s doesn’t matter what valued specified for MSLINK – MS handles it on it’s own
  3. Select one element which my_attribute must be set 90 and Attach Active Entity to it.


    If there are other elements that must be attributed with my_attribute=90, then
  4. Linkage Mode = Duplicate,
  5. Define Active Entity Graphically , picking previously linked element, with my_attribute=90
    , or key-in FI=SELECT * FROM my_table WHERE my_attribute = 90     (say we don’t know who and for what element made 1-3 steps)
  6. select needed elements and Attach Active Entity

 And the following algoritm is:

-          work with Linkage Mode = Duplicate, and Define Active Entity Graphically or with key-in FI=SELECT * FROM my_table WHERE my_attribute = XX

-          if we have some new my_attribute value (key in FI=SELECT * FROM my_table WHERE my_attribute = XX returnes SELECT statement returned no rows), than switch temporary Linkage Mode to New, key-in AE=INSERT INTO my_table (my_attribute,MSLINK) VALUES (XX,1), Attach Active Entity and switch Likage Mode back to Duplicate.

 Isn’t there some easier way to do it? May be using Visual SQL Query Builder?

 If I forgotten to set Linkage Mode back to Duplicate, and worked for a while with New, making copy-rows with the same my_attribute, is there any way to fix it? I mean delete from my_table rows ("copies") with the same my_attribute value, leaving only one, and link corresponding dgn-elements to this row.

Regards,

Sergei Fadeev

P.S. WinXP, Microstation  08.11.07.177, MS SQL Server 2008