I just started learning dynamic sql from free online sources. I'm confused with the multiple quotes on those examples.
Is there any logic behind those quotes?
Here is one example :
DECLARE @sqlCommand varchar(1000)
DECLARE @columnList varchar(75)
DECLARE @city varchar(75)
SET @columnList = 'CustomerID, ContactName, City'
SET @city = '''London'''
SET @sqlCommand = 'SELECT ' + @columnList + ' FROM customers WHERE City = ' + @city
Why have they put three quotes in London?