Cant truncate table because of FK:s? Delete all rows. Then use this script to reset identity seed to 1.
Did you ever change the schema in SSMS and the queries gets red-underlined as the syntax is errorous cause the "spell checker" does not have the altered schema information?
After a database restore the database will have its user but the SQL Server login havent't been created. Fix the mapping by adding the SQL Server login and then map them together using sp_change_users_login sproc.
A lookup table with 10 records can have a PK of int or tinyint. Thats 3 bytes in difference. A 1 million record table referencing that table will then use either 4,000,000 or 1,000,000 bytes. That column will probable be part in an index. That index tree will be bigger and take more time to process, and using more RAM and CPU. Query will take longer and tables are locked a longer time. It is easy to choose a smaller datatype and you will gain much performance from doing so.
Let SQL Server be able to process data as effective as possible and do not confuse the optimizer and query plan caching mechanisms with logic in your SQL code.
Finally we got it... This will make working with weeks in Europe a lot more easy.
Transfer both schema and data using the database publishing wizard and sqlcmd. But where is the Database Publishing Wizard for SQL Server 2008. And what to do when the generated script is huge?
Instead of converting datatypes (to varchar) back and forth, this is much faster.
Make the execution of an SQL script sleep for a certain amount of time.
This is how to get a comma delimited string from row values using COALESCE or FOR_XML
Display stats for individual SQL execute statements.
I took a quick look at the schema of the Orchard database. There's some tables there but it seemed to lack any FK constraints.