Showing posts with label Sql Script. Show all posts
Showing posts with label Sql Script. Show all posts

Monday, December 1, 2014

Sql Query Statement Execution Order

FROM
ON
JOIN
WHERE
GROUP BY
WITH CUBE or WITH ROLLUP
HAVING
SELECT
DISTINCT
ORDER BY
TOP

Monday, March 31, 2014

sql server cache Plan query

SELECT top 100 text.text as sql, cp.usecounts, cp.cacheobjtype,cp.objtype, plan1.dbid, plan1.query_plan,cp.plan_handle
FROM sys.dm_exec_cached_plans as cp
CROSS APPLY sys.dm_exec_sql_text(plan_handle)  as text
CROSS APPLY sys.dm_exec_query_plan(plan_handle) as plan1
WHERE usecounts > 1
ORDER BY usecounts DESC;

Wednesday, December 18, 2013

Insufficient memory to continue the execution of the program. (mscorlib)

Open Command Prompt
sqlcmd -d {database name} -i {script file full path}

Sample:

C:\Program Files (x86)\Microsoft Visual Studio 11.0>sqlcmd -d master -i C:\Users\corenx\Desktop\script.sql