Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Friday, July 22, 2011

MS SQL Server - Clear Cache - for Query Timing

[Using MS-SQL Server] When timing a query for the purposes of optimization, the query may well run quicker on re-execution subsequent to the initial execution - due to caching by the db engine.

In order to meaningfully compare execution time across optimization attempts, the cache needs to be cleared, and this can be done by executing


DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE
go


between query timings.

To turn query timing on - SET STATISTICS TIME ON
To turn query timing off - STATISTICS TIME OFF

Wednesday, July 21, 2010

Monday, July 19, 2010

Untangling Object Dependencies in MS-SQL-08

useful TechRepublic Blog

1. get a list of all system objects from sys.objects
name,object_id,parent_object_id,type

2. determine individual dependencies from sys.sql_dependencies
object_id, referenced_major_id

3. use a topological sort to untangle the list of dependencies to a simple dependency tree.

Thursday, July 15, 2010

PyMSSql - import _mssql - ImportError: DLL load failed: The specific module could not be found

under windows xp pro,
When attempting to import pymssql.py,
I experienced the following error:


"
import _mssql
ImportError: DLL load failed: The specific module could not be found
"

So this is all a bit cryptic, but after googling, which suggested using a windows diagnostic tool [ProcessMonitor] to locate the failing process, it turns out that what is missing is an (accessible) copy of 'mscvr71.dll', which can be downloaded off the net, and should be copied to 'c:\windows\system32\', or 'c:\windows\system\' if running 64bit windows.

you then need to run 'regsvr32 msvcr71.dll' from the command line, in the directory that you copied the dll to.

cant find entrypoint

if you get a 'cant find entrypoint' type error message, its actually still all ok, pymssql should run just fine by that point.