Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Posts
    153

    Smile Unanswered: trigger not returnign desired result

    Hi guys,
    im migrating data from excel to database (lookup_student table) ad from this table i want to migrate data into another table (student_details) by selecting only distinct values, should not repeat data.

    i have tried with insertion trigger on lookup_student table so that when data gets inserted into this table then automatically it should fire trigger ny selecting only distinct values and gets inserted into another table (student_details).


    thanks

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by sunny_007 View Post
    I have an another idea. We can migrate data from excel to our database using SSIS this table will be our dummy table. we will create another main table and we will fire trigegr. insertion on dummy table will insert values in the main table as well as in the mean time we can insert only unique values in that table
    Quote Originally Posted by pootle flump View Post
    I would not use a trigger. I would use a procedure. Using a trigger introduces complications.
    Quote Originally Posted by blindman View Post
    The same process that loads the staging table can fire the sproc when it is finished.
    Do not use a trigger. That will cause a lot of complications for debugging the process.
    Exactly why we said don't use triggers.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    In fact, here's something to bear in mind every time you think "I know! I can do this with a trigger!"
    SQL Server Forums - Trigger Madness
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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