Tuning quick tips Getting the entire record before apply condition. -> Solution: Apply condition and paging before select. Using sub-query -> Solution: Turn it into join Using Table Variable being used with large data -> Solution: use Temp Table When a query performs badly, 3 things above are the most common causes I came across.… Continue reading SQL query performance tuning
Tag: mssql
MSSQL backup & restore using script.sql
MSSQL has the function called backup & restore, which is useful. It works fine between different versions. But, if you need to restore from script.sql, you can do it on command line. sqlcmd -S <server> -i C:\<your file here>.sql -o Full explanation : Link and Sometimes connection string can be tricky. You can get full help… Continue reading MSSQL backup & restore using script.sql