<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UKoom &#187; SQL Server</title>
	<atom:link href="http://www.ukoom.com/category/database/sql-server/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ukoom.com</link>
	<description>Documentum, SharePoint, Alfresco, ECM...</description>
	<lastBuildDate>Tue, 25 Oct 2011 15:11:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SQL Server Profiler &#8211; Only TrueType fonts are supported</title>
		<link>http://www.ukoom.com/sql-server-profiler-only-truetype-fonts-are-supported.htm</link>
		<comments>http://www.ukoom.com/sql-server-profiler-only-truetype-fonts-are-supported.htm#comments</comments>
		<pubDate>Sun, 22 Aug 2010 05:12:27 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=1115</guid>
		<description><![CDATA[Error message &#8211; &#8220;Only TrueType fonts are supported. This is not a TrueType font.&#8221; was thrown when using SQL Server Profiler. Solution： 1. Open SQL Server Profilr 2. Go to &#8216; Tool&#8217;Menu 3. Select Options 4. Change the font name to &#8220;Arial&#8221; 5. Click OK.]]></description>
			<content:encoded><![CDATA[<p>Error message &#8211; &#8220;Only TrueType fonts are supported. This is not a TrueType font.&#8221; was thrown when using SQL Server Profiler.</p>
<p>Solution：</p>
<p>1. Open SQL Server Profilr</p>
<p>2. Go to &#8216; Tool&#8217;Menu</p>
<p>3. Select Options</p>
<p>4. Change the font name to &#8220;Arial&#8221;</p>
<p>5. Click OK.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/sql-server-profiler-only-truetype-fonts-are-supported.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DateDiff 用法</title>
		<link>http://www.ukoom.com/datediff-%e7%94%a8%e6%b3%95.htm</link>
		<comments>http://www.ukoom.com/datediff-%e7%94%a8%e6%b3%95.htm#comments</comments>
		<pubDate>Wed, 13 Jan 2010 08:17:04 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=1013</guid>
		<description><![CDATA[DateDiff 用法 DateDiff: SQL server函数 返回 Variant (Long) 的值，表示两个指定日期间的时间间隔数目。 语法 DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]]) DateDiff 函数语法中有下列命名参数： 部分 描述 interval 必要。字符串表达式，表示用来计算date1 和 date2 的时间差的时间间隔 Date1□date2 必要；Variant (Date)。计算中要用到的两个日期。 Firstdayofweek 可选。指定一个星期的第一天的常数。如果未予指定，则以星期日为第一天。 firstweekofyear 可选。指定一年的第一周的常数。如果未予指定，则以包含 1 月 1 日的星期为第一周。 设置 interval 参数的设定值如下： 设置 描述 yyyy 年 q 季 m 月 y 一年的日数 d 日 w 一周的日数 ww 周 hh [...]]]></description>
			<content:encoded><![CDATA[<p>DateDiff 用法<br />
DateDiff: SQL server函数</p>
<p>返回 Variant (Long) 的值，表示两个指定日期间的时间间隔数目。</p>
<p>语法</p>
<p>DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])</p>
<p>DateDiff 函数语法中有下列命名参数：</p>
<p>部分 描述</p>
<p>interval 必要。字符串表达式，表示用来计算date1 和 date2 的时间差的时间间隔</p>
<p>Date1□date2 必要；Variant (Date)。计算中要用到的两个日期。</p>
<p>Firstdayofweek 可选。指定一个星期的第一天的常数。如果未予指定，则以星期日为第一天。</p>
<p>firstweekofyear 可选。指定一年的第一周的常数。如果未予指定，则以包含 1 月 1 日的星期为第一周。</p>
<p>设置</p>
<p>interval 参数的设定值如下：</p>
<p>设置 描述</p>
<p>yyyy 年</p>
<p>q 季</p>
<p>m 月</p>
<p>y 一年的日数</p>
<p>d 日</p>
<p>w 一周的日数</p>
<p>ww 周</p>
<p>hh 时</p>
<p>n 分钟</p>
<p>s 秒</p>
<p>firstdayofweek 参数的设定值如下：</p>
<p>常数 值 描述</p>
<p>vbUseSystem 0 使用 NLS API 设置。</p>
<p>vbSunday 1 星期日（缺省值）</p>
<p>vbMonday 2 星期一</p>
<p>vbTuesday 3 星期二</p>
<p>vbWednesday 4 星期三</p>
<p>vbThursday 5 星期四</p>
<p>vbFriday 6 星期五</p>
<p>vbSaturday 7 星期六</p>
<p>常数 值 描述</p>
<p>vbUseSystem 0 用 NLS API 设置。</p>
<p>vbFirstJan1 1 从包含 1 月 1 日的星期开始（缺省值）。</p>
<p>vbFirstFourDays 2 从第一个其大半个星期在新的一年的一周开始。</p>
<p>vbFirstFullWeek 3 从第一个无跨年度的星期开始。</p>
<p>说明</p>
<p>DateDiff 函数可用来决定两个日期之间所指定的时间间隔数目。例如，可以使用 DateDiff 来计算两个日期之间相隔几日，或计算从今天起到年底还有多少个星期。</p>
<p>为了计算 date1 与 date2 相差的日数，可以使用“一年的日数”(y) 或“日”(d)。当 interval 是“一周的日数”(w) 时，DateDiff 返回两日期间的周数。如果 date1 是星期一，DateDiff 计算到 date2 为止的星期一的个数。这个数包含 date2 但不包含 date1。不过，如果 interval 是“周”(ww)，则 DateDiff 函数返回两日期间的“日历周”数。由计算 date1 与 date2 之间星期日的个数而得。如果 date2 刚好是星期日，则 date2 也会被加进 DateDiff 的计数结果中；但不论 date1 是否为星期日，都不将它算进去。</p>
<p>如果 date1 比 date2 来得晚，则 DateDiff 函数的返回值为负数。date2-data10</p>
<p>firstdayofweek 参数会影响使用时间间隔符号 “W” 或 “WW” 计算的结果。</p>
<p>如果 date1 或 date2 是日期文字，则指定的年份成为该日期的固定部分。但是，如果 date1 或 date2 用双引号 (&#8221; &#8220;) 括起来，且年份略而不提，则在每次计算表达式 date1 或 date2 时，当前年份都会插入到代码之中。这样就可以书写适用于不同年份的程序代码。</p>
<p>在计算 12 月 31 日和来年的 1 月 1 日的年份差时，DateDiff 返回 1 表示相差一个年份，虽然实际上只相差一天而已。</p>
<p>示例</p>
<p>此示例确定在 pubs 数据库中标题发布日期和当前日期间的天数。</p>
<p>USE pubsGOSELECT DATEDIFF(day, pubdate, getdate()) AS no_of_daysFROM titlesGO</p>
<p>DATEDIFF函数在Access和MSSQL中的使用区别</p>
<p>ACCESS中用法：DATEDIFF(&#8216;day&#8217;, pubdate, Now())</p>
<p>MSSQL中用法：DATEDIFF(day, pubdate, getdate())</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/datediff-%e7%94%a8%e6%b3%95.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server JDBC Connection Errors: Error establishing socket, connection refused&#8230;</title>
		<link>http://www.ukoom.com/sql-server-jdbc-connection-errors-error-establishing-socket-connection-refused.htm</link>
		<comments>http://www.ukoom.com/sql-server-jdbc-connection-errors-error-establishing-socket-connection-refused.htm#comments</comments>
		<pubDate>Wed, 06 Jan 2010 12:29:27 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=1007</guid>
		<description><![CDATA[SQL Server JDBC Connection Errors: Error establishing socket, connection refused&#8230; java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSConnection.(Unknown Source) at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source) SQL server 2005 JDBC Driver: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has [...]]]></description>
			<content:encoded><![CDATA[<p>SQL Server JDBC Connection Errors: Error establishing socket, connection refused&#8230;<br />
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.<br />
        at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)<br />
        at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)<br />
        at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)<br />
        at com.microsoft.jdbc.sqlserver.tds.TDSConnection.(Unknown Source)<br />
        at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)<br />
        at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)<br />
        at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)<br />
        at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)</p>
<p>SQL server 2005 JDBC Driver:<br />
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed.<br />
                                     java.net.ConnectionException: Connection refused: connect<br />
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)<br />
        at com.microsoft.sqlserver.jdbc.SQLServerException.connect(Unknown Source)<br />
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)</p>
<p>For this kind of database connection problem, there are always two distinct issues:<br />
The SQL server itself is not running or TCP/IP is disabled. That can be confirmed by run<br />
netstat</p>
<p>and see it is listed there. And then run </p>
<p>telnet localhost 1433</p>
<p>and see it can connect (or whatever port number). </p>
<p>Even if the server is running, a client program such like jdbc may still fail to connect to it because of a<br />
firewall </p>
<p>For testing, you can turn off the XP firewall. And if you have other firewall running, check the firewall log and see any activities that might be related. </p>
<p>You can also verify whether or not your server is running from the </p>
<p>SQL Server Network Utility<br />
on the server, or from another client utility such as</p>
<p>SQL Query Analyzer </p>
<p>or a command line utility such as </p>
<p>osql </p>
<p>To check the enabled protocols for a server, follow these steps:<br />
In SQL Server 2000, start the SQL Server Network Utility (svrnetcn.exe).<br />
On the General tab, select the instance of Microsoft SQL Server on which to load an installed server network library.<br />
Make sure that TCP/IP appears in the Enabled Protocols list.<br />
To find the port number, in the Enabled Protocols list, click TCP/IP, and then click Properties. The Properties dialog box displays the port number.<br />
There is an known bug: SQL Server May Not Listen on TCP/IP Sockets When TCP/IP is the Only Protocol<br />
In a SQL Server 2000 custom installation, if TCP/IP is the only selected protocol and all other protocols are disabled, SQL Server may not initialize and listen on TCP/IP sockets. The Server Network Utility shows that it is listening only on TCP/IP port 1433 even though it is not. To identify if SQL Server is not listening on TCP/IP, check to see if the value for TcpPort in the following registry key is incorrectly set to blank or empty: </p>
<p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\ [Instance Name]\MSSQLServer\SuperSocketNetLib\Tcp\REG_SZ TcpPort= </p>
<p>To work around this problem, follow these steps: </p>
<p>Start Registry Editor (Regedt32.exe).<br />
Locate the TcpPort value in the following key in the registry:<br />
Named instance:<br />
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\[InstanceName]\MSSQLServer\SuperSocketNetLib\Tcp\TcpPort </p>
<p>Default instance:<br />
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer<br />
\MSSQLServer\SuperSocketNetLib\TCP\TcpPort </p>
<p>. On the Edit menu, click String. Enter either of the following values:<br />
a. Type the port number you want. -or-<br />
b. Enter a value of 0 to have SQL Server dynamically detect and assign a port the next time SQL Server starts.</p>
<p>Click OK.<br />
Quit Registry Editor.<br />
SQL Server 2000 Service Pack 4 (SP4): </p>
<p>You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (also called MSDE) that has known security vulnerabilities when used in conjunction with the Microsoft Windows Server 2003 family. To reduce your computer&#8217;s vulnerability to certain virus attacks, the TCP/IP and UDP network ports of Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable these ports, you must install SQL Server 2000 Service Pack 3a, or the most recent service pack for Microsoft SQL Server 2000 or MSDE from    http://www.microsoft.com/sql/downloads/2000/sp4.mspx. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/sql-server-jdbc-connection-errors-error-establishing-socket-connection-refused.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TIPs for SQL Server 2005</title>
		<link>http://www.ukoom.com/tips-for-sql-server-2005.htm</link>
		<comments>http://www.ukoom.com/tips-for-sql-server-2005.htm#comments</comments>
		<pubDate>Fri, 27 Feb 2009 08:53:22 +0000</pubDate>
		<dc:creator>ukoom</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.ukoom.com/?p=560</guid>
		<description><![CDATA[connect database using port: Assign tcp port:]]></description>
			<content:encoded><![CDATA[<p>connect database using port:</p>
<p><a href="http://www.ukoom.com/wp-content/uploads/2009/02/sqlserver2005portconnection.jpg"><img class="alignnone size-medium wp-image-562" title="sqlserver2005portconnection" src="http://www.ukoom.com/wp-content/uploads/2009/02/sqlserver2005portconnection-300x199.jpg" alt="" width="300" height="199" /></a></p>
<p>Assign tcp port:</p>
<p><a href="http://www.ukoom.com/wp-content/uploads/2009/02/sqlserver2005tcpport.jpg"><img class="alignnone size-medium wp-image-561" title="sqlserver2005tcpport" src="http://www.ukoom.com/wp-content/uploads/2009/02/sqlserver2005tcpport-264x300.jpg" alt="" width="264" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ukoom.com/tips-for-sql-server-2005.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

