Turning Relationships off/on through ASP

Results 1 to 2 of 2

Thread: Turning Relationships off/on through ASP

  1. #1
    Thundata Guest

    Default Turning Relationships off/on through ASP

    Does anyone know if it is possible to turn off and on relationships between tables via ASP or directly through an SQL statement? If so could you please provide a snippet of code to demonstrate this function. Thanks

  2. #2
    peterjl@austec.net.au Guest

    Default RE: Turning Relationships off/on through ASP

    I won&#039;t show you a snippet, because I do not know the exact syntax, but I will give hints.<BR><BR>What you need is two Sql commands which you would execute via the ADO Connection.Execute method:<BR><BR>oConn.Execute SqlCmdString<BR><BR><BR>The sql is like this to setup relationship :<BR><BR>Create Index [IndexName] foreignkey<BR><BR>and to delte relationship:<BR><BR>Drop Index [IndexName]<BR><BR>however I am not sure if it may be:<BR><BR>Alter Table YourTable add ForeignKey ....;<BR>and<BR>Alter Table Yourtable drop ForeignKey ...;<BR><BR>You will need consult your DBMS&#039;s Reference manual to determine the exact syntax.<BR><BR>However having said all this, I wonder why you would want to do this? I feel that it is not a good idea. You will probably have concurrency problems, and will need to do appropraite loccking, etc.

Posting Permissions

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