Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    Varna
    Posts
    20

    Lightbulb Unanswered: Do you like to break the rules ?

    Not long ago I accountered this situation: I had two databases on "MS SQL Server". In one of the databases there was a nomenclature with very large primary key.
    I had to transport that nomenclature and transform the wide PK into single identity column into the other database.

    I decided to use a function for that transformation. BUT that function had to mark somewhere which combination of the PK columns is relative to which identity value. BUT functions CAN'T WRITE under MSSQL.
    So I took the challenge and mine all sources of information. The result was a function "Exec4Fun" that breaks the rule.
    I suppose that with this function it's possible to avoid the restriction for triggers, which prevents writing in the triggering table? (not tested yet)

    If someone needs such tools, just write back your e-mail and I'll send some code.

    All the best and have fun
    Prob Solver

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Oh yeah? Wow!!! Let's see if it's a copy of what Itzik Ben Gan talks about in his "back doors" to UDF's. And here's the code from his article (http://www.winnetmag.com/Files/09/41845/41845.zip)
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Dec 2003
    Location
    Varna
    Posts
    20

    Lightbulb A little better

    My Fun has the same origins as "Listing_04.UsingOPENQUERY()toPerformanUpdate.txt" . There was used the linked-server approach which lies on ADODB. But I got deeper. I use directly ADODB through "sp_OACreate" procedures and also handle the errors.

    If you like tricky code I can send you how to roll a cursor on an EXEC('')

    Have a nice code
    Prob Solver

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    There's no trick there, I've seen too much of that, and re-written most of it. I am glad I am out of that dirty business
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  5. #5
    Join Date
    Dec 2003
    Location
    Varna
    Posts
    20
    That's it - sysadmins . . .
    You all forgot the Mother ASseMbler (MASM) and how HARD is the planting for the SOFT to be neet and tidy

    All the best. Thanks for the company.
    Prob Solver

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •