Hi I have the following:
Now before it goes into the insert statement i want it to check the database to see if the record exist already if it does then do not do anything...
Can I do that in a store proc and how?
Thanks
Code:
ALTER procedure latlong_export
@SF_GUID char(18)
,@SF_NAME char(28)
,@SF_STREET char(28)
,@SF_CITY char(21)
,@SF_STATE char(2)
,@SF_ZIP char(10)
,@SF_RECORD_TYPE varchar(18)
as
IF @SF_GUID = SF_GUID
insert into SF_Locations
(SF_GUID
,SF_NAME
,SF_STREET
,SF_CITY
,SF_STATE
,SF_ZIP
,SF_RECORD_TYPE)
values
(@SF_GUID
,@SF_NAME
,@SF_STREET
,@SF_CITY
,@SF_STATE
,@SF_ZIP
,@SF_RECORD_TYPE)
Can I do that in a store proc and how?
Thanks