I am creating a stored procedure. Currently queries are being stored in variables. For example:
@sample = 'SELECT * FROM WS_CoolApp_ASample'
@sample += 'Where DATASOURCE.FName = @finder AND DATASOURCE.Age = 23'
I want to remove that 'DATASOURCE.' from the query if a condition is true. So far I've tried:
IF (true)
REPLACE(@sample, "DATASOURCE.", "")
Why isn't this working?