Home Forums SQL Server 2008 SQL Server 2008 - General Passing comma separated values for IN list in DELETE statement from SQLCMD RE: Passing comma separated values for IN list in DELETE statement from SQLCMD

  • Sean Lange (9/11/2012)


    CELKO (9/11/2012)


    I have a two articles on this topic at Simple Talk. There is no need to throw away performance, maintainabilty and portability to do this.

    http://www.simple-talk.com/sql/learn-sql-server/values()-and-long-parameter-lists/

    http://www.simple-talk.com/sql/learn-sql-server/values()-and-long-parameter-lists---part-ii/

    If portability to another DBMS is a concern then the methods Joe discusses are a good solution.

    On the other hand, if you don't see yourself switching to another DBMS in the near future and you want to keep your maintenance a lot simpler then you might be better off following the ideas that Craig has suggested. For me, I am a sql server guy and I don't really worry about portability. I also don't want to have to alter my procedure and redeploy my data access tier every time I need to make the list longer.

    +1000^1000!

    Use the capabilities of the system you are using. How often do you see companies changing database systems? It isn't something done lightly or on a frequent basis.