Query times out when executed from web, but super-fast when executed from SSMS

So your C# code is sending an ad hoc SQL query to SQL Server, using what method? Have you considered using a stored procedure? That would probably ensure the same performance (at least in the engine) regardless of who called it. Why? The ARITHABORT setting is one of the things the optimizer looks at when … Read more

How can I automate the “generate scripts” task in SQL Server Management Studio 2008?

SqlPubwiz has very limited options compared to the script generation in SSMS. By contrast the options available with SMO almost exactly match those in SSMS, suggesting it is probably even the same code. (I would hope MS didn’t write it twice!) There are several examples on MSDN like this one that show scripting tables as … Read more

Sql Server ‘Saving changes is not permitted’ error ► Prevent saving changes that require table re-creation

From Save (Not Permitted) Dialog Box on MSDN : The Save (Not Permitted) dialog box warns you that saving changes is not permitted because the changes you have made require the listed tables to be dropped and re-created. The following actions might require a table to be re-created: Adding a new column to the middle … Read more