September 6, 2019 at 12:00 am
Comments posted to this topic are about the item Transient Synonyms
September 6, 2019 at 6:19 am
Interesting question to end the week on, thanks Steve
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
September 6, 2019 at 6:56 am
You also can create synonym without an existing object.
In your example you mismatched the synonym StagingSongs with SongStaging
CREATE SYNONYM SongStaging FOR #songs
GO
CREATE PROCEDURE dbo.LoadSongs
AS
INSERT Songs
(
songid,
title,
releasedate,
genre
)
SELECT songid,
title,
releasedate,
genre
FROM dbo.StagingSongs
WHERE title NOT IN (SELECT title FROM Songs)
GO
September 6, 2019 at 11:21 am
I'm confused. What data is added, given that the temp table #songs never had anything in it?
September 6, 2019 at 5:09 pm
In your example you mismatched the synonym StagingSongs with SongStaging
I noticed this as well, but since there was no option for "Invalid object name 'dbo.StagingSongs'.", I assumed the intention was for the synonym name to match the object name in the SELECT query.
September 11, 2019 at 9:02 pm
#$%#$ apologies for the mismatched names
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply