• I have used the filetable to store the tsql scripts. what can be the best way to run them against the server. the only road block i have using the exec(@sql) or execute_sql (@command) is the 'GO' statement in the filetable script.

    Any help will be appriciated. Thanks

    There are different methods for querying the contents of a document stored in a filetable. I haven't done it personally but have seen Sam Nasr do it (SQL Saturday Detroit :w00t:). Sam Nasr has some articles out there about this.

    That said, what you are doing sounds like a bad idea to me. Filetables are not intended to for storing documents that contain scripts (SQL or other) that are executed directly from the filetable. The idea of a file on a file share (secured or otherwise) with scripts that can be executed from inside SQL Server. That sounds scary for too many reasons to detail in one post.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001