I need to specify a set of values for a bind variable, but Toad does not work with this sort of specification. I dont get any or get the wrong results when I try to do this.
Example:
SELECT AddressID, AddressLine1, AddressLine2, City, StateProvinceID,
PostalCode, rowguid, ModifiedDate
FROM AdventureWorks.Person.Address
WHERE City in (:CityNames)
I want variable CityNames to have Seattle, Dallas
I can enter this in to thevalue field but it does not give me results.
It is a T-SQL limitation to set a parameter to an array of values. Neither SMS or Toad can do this.
WORKAROUND:
There is no workaround specifically for Toad but the query could be to rewritten.
Example:
Run the query dynamically.
declare @firstnameset varchar(40)
set @firstnameset = (Alice, Nancy) -- thats 2 single quotes and not double quotes
exec(SELECT * FROM employees WHERE Firstname in + @firstnameset)
STATUS:
An enhancement request has been submitted to Development for consideration in future release of Toad for SQL Server.
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center