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 )
User Profile
Collapse
-
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)
... -
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...Leave a comment:
No activity results to display
Show More
Leave a comment: