User Profile

Collapse

Profile Sidebar

Collapse
skirack
skirack
Last Activity: Jun 15 '07, 07:02 PM
Joined: Jun 29 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • At least with SQL 2000 and higher... LEFT & Right functions found in Access appear in SQL server.

    Syntax:
    LEFT ( character_expre ssion , integer_express ion )
    RIGHT ( character_expre ssion , integer_express ion )
    See more | Go to post

    Leave a comment:


  • skirack
    started a topic Problem with Composite PK

    Problem with Composite PK

    I'm trying to limit an INSERT Statement to only insert rows into the destination table where they don't match the PK. I understand how I can do this using the code below but it doesn't account for a composite key. Any suggestions?

    insert into dbo.Destination (col1, col2, ...)
    select col1, col2, ...
    from dbo.Source s
    where not exists (select * from dbo.Destination d
    where d.PrimaryKey = s.PrimaryKey)

    ...
    See more | Go to post

  • skirack
    replied to problem with duplicate keys
    I'm having a similar issue here, i'm using a Insert Trigger to add a row to an EXCEPTIONS table when a condition is met during the insert process. The condition could be met multiple times, but I only need 1 record to go into the EXCEPTIONS table per PK combination. I could limit this using a WHERE clause however the EXCEPTIONS table has a composite primary key and I'm not sure how to check for that.


    INSERT INTO STAFFING_EXCEPT IONS...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...