Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
krillehbg
Starting Member
1 Post |
Posted - 2015-03-26 : 09:03:26
|
Hi everyone,i have a INSERT INTO where i retunr the result from a store procedure.But i want to only insert the data if the row not already exist.How can i do that? (See Where xxxxxxxxxxxx).I can't use a function as i store data in a temporary table in the store procedure.Please help!--Get Generated TimesINSERT INTO @GeneratedTimes( ResourceId , DateFrom , DateTo )EXEC dbo.P_GenerateTimes @ApplicationId , @EventId , @FromDate , @ToDate , @WeekScheduleId , @FromTimeToBook , @ToTimeToBookWHERE xxxxxxxxxxxxxxxxxx |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-03-26 : 09:53:50
|
Insert the output of the stored procedure into a temp table, then merge the temp table with your target table. |
|
|
|
|
|