Category Archives: Microsoft SQL

MS SQL – Preferred data types

Decimal Numbers… DECIMAL(18,0) will allow 0 digits after the decimal point. Use something like DECIMAL(18,4) instead that should do just fine! That gives you a total of 18 digits, 4 of which after the decimal point (and 14 before the decimal point). Question Sum’ing data of type REAL resulted in a total with about 10… Read More »

Open Windows Firewall Ports for SQL Server

http://blogs.msdn.com/b/jorgepc/archive/2009/08/25/open-firewall-ports-for-sql-server-the-easy-way.aspx @echo =========  SQL Server Ports  ===================  @echo Enabling SQLServer default instance port 1433  netsh firewall set portopening TCP 1433 “SQLServer”  @echo Enabling Dedicated Admin Connection port 1434  netsh firewall set portopening TCP 1434 “SQL Admin Connection”  @echo Enabling conventional SQL Server Service Broker port 4022   netsh firewall set portopening TCP 4022 “SQL Service Broker” … Read More »

Show locked Tables, Views etc in Microsoft SQL

SELECT DISTINCT object_name(a.rsc_objid) AS object, a.req_spid, b.loginame FROM master.dbo.syslockinfo a (nolock) JOIN master.dbo.sysprocesses b (nolock) on a.req_spid=b.spid WHERE object_name(a.rsc_objid) IS not null ORDER BY object