<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Sql on Wapnet Blog</title><link>https://blog.wapnet.nl/category/sql/</link><description>Recent content in Sql on Wapnet Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 15 May 2018 14:37:01 +0000</lastBuildDate><atom:link href="https://blog.wapnet.nl/category/sql/feed.xml" rel="self" type="application/rss+xml"/><item><title>Compare 2 sql tables</title><link>https://blog.wapnet.nl/2018/05/compare-2-sql-tables/</link><pubDate>Tue, 15 May 2018 14:37:01 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=1799</guid><description>&lt;p&gt;A simple SQL compare is realy easy:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;select * from dbtest02.dbo.article except select * from dbtest01.dbo.article&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Source: &lt;a href="https://www.mssqltips.com/sqlservertip/2779/ways-to-compare-and-find-differences-for-sql-server-tables-and-data/"&gt;https://www.mssqltips.com/sqlservertip/2779/ways-to-compare-and-find-differences-for-sql-server-tables-and-data/&lt;/a&gt;&lt;/p&gt;</description></item><item><title>How to truncate Mirrored Database Log File</title><link>https://blog.wapnet.nl/2017/09/how-to-truncate-mirrored-database-log-file/</link><pubDate>Thu, 28 Sep 2017 09:23:15 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=1769</guid><description>&lt;p&gt;First backup your transaction logging:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Tasks &amp;gt; Backup &lt;a href="https://blog.wapnet.nl/wp-content/uploads/2017/09/sql3.jpg"&gt;&lt;img loading="lazy" src="https://blog.wapnet.nl/wp-content/uploads/2017/09/sql3.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Select transactionlog backup en select a disk where to backup &lt;a href="https://blog.wapnet.nl/wp-content/uploads/2017/09/SQL2.jpg"&gt;&lt;img loading="lazy" src="https://blog.wapnet.nl/wp-content/uploads/2017/09/SQL2.jpg"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Now check the status with &lt;strong&gt;DBCC LOGINFO(DATABASENAME)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Check if the last status record is 0 (zero)&lt;img loading="lazy" src="https://blog.wapnet.nl/wp-content/uploads/2017/09/SQL1-1.jpg"&gt;&lt;/li&gt;
&lt;li&gt;When the status is 2 make another backup&lt;/li&gt;
&lt;li&gt;When the status is 0 you can run: &lt;strong&gt;DBCC SHRINKFILE(2)&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can use this script also:
&lt;code&gt;Backup LOG DBNAME TO DISK = 'C:\SQL_TMP\transactionlog.trn' WITH STATS GO DBCC LOGINFO(DBNAME) DBCC SHRINKFILE(2)&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Windows IOPS and MB/s benchmarking</title><link>https://blog.wapnet.nl/2016/09/windows-iops-and-mbs-benchmarking/</link><pubDate>Sun, 11 Sep 2016 10:05:08 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=1696</guid><description>&lt;p&gt;You have bought een new system and the first thing what you want to do is check the disk performance (ehhh that&amp;rsquo;s always the first thing I want to know :P )&lt;/p&gt;
&lt;p&gt;There  is one tool I always use: &lt;a href="https://www.attotech.com/disk-benchmark/"&gt;ATTO Disk Benchmark&lt;/a&gt; &lt;a href="https://blog.wapnet.nl/wp-content/uploads/2016/09/disk-benchmark.png"&gt;&lt;img alt="disk-benchmark" loading="lazy" src="https://blog.wapnet.nl/wp-content/uploads/2016/09/disk-benchmark.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is a very nice tool to quickly see how fast your troughput is of your new system.&lt;/p&gt;
&lt;p&gt;But sometimes you want to check your IOPS. Then you can use another nice microsoft commandline benchmark tool &lt;a href="https://gallery.technet.microsoft.com/DiskSpd-a-robust-storage-6cd2f223"&gt;DiskSpd&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Remote connect SQL Express</title><link>https://blog.wapnet.nl/2013/08/remote-connect-sql-express/</link><pubDate>Mon, 12 Aug 2013 12:51:42 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=1304</guid><description>&lt;ol&gt;
&lt;li&gt;Start SQL Server Surface Area Configuration &amp;gt; Remote connections&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.wapnet.nl/wp-content/uploads/2013/08/SQL-Surface.png"&gt;&lt;img alt="SQL-Surface" loading="lazy" src="https://blog.wapnet.nl/wp-content/uploads/2013/08/SQL-Surface.png"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Select &amp;ldquo;using both TCP/IP and named pipes&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Start &amp;ldquo;SQL Server Configuration Manager&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Find out the dynamic port&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.wapnet.nl/wp-content/uploads/2013/08/SQL-dynamicPort.png"&gt;&lt;img alt="SQL-dynamicPort" loading="lazy" src="https://blog.wapnet.nl/wp-content/uploads/2013/08/SQL-dynamicPort.png"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Now connect to the SQL server from a remote server:&lt;/li&gt;
&lt;li&gt;HOSTNAMESERVER\MSSQL$SQLEXP_VIM,49382&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.wapnet.nl/wp-content/uploads/2013/08/sql-connect.png"&gt;&lt;img alt="sql-connect" loading="lazy" src="https://blog.wapnet.nl/wp-content/uploads/2013/08/sql-connect.png"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Error 29528 When Installing SQL Service Pack 4</title><link>https://blog.wapnet.nl/2012/08/error-29528-when-installing-sql-service-pack-4/</link><pubDate>Wed, 01 Aug 2012 22:01:35 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=956</guid><description>&lt;p&gt;Today I had this problem for the second time. Last time it cost me 3 hours to find the solution. Now I find your article and I fixed it in 30 minutes :)&lt;/p&gt;
&lt;p&gt;My Exact error was (summary.txt):
MSP Error: 29528  The setup has encountered an unexpected error while Setting Internal Properties. The error is: Fatal error during installation.&lt;/p&gt;
&lt;p&gt;The workaround resolution involves the following steps:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For a stand-alone installation of SQL Server 2005&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>SQL Reporting Services slow with Internet Explorer</title><link>https://blog.wapnet.nl/2012/04/sql-reporting-services-slow-with-internet-explorer/</link><pubDate>Wed, 11 Apr 2012 13:33:51 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=853</guid><description>&lt;p&gt;When you access the reporting services over SSL you can have the problem that the reporting services GUI under IE is very slow.&lt;/p&gt;
&lt;p&gt;The solution is quite simple: Login with the servername or domain name. E.g: SERVERNAME\username&lt;/p&gt;
&lt;p&gt;This problem exist under IE 8 and IE9 under Server 2008, 2008r2, Vista and Windows 7.&lt;/p&gt;</description></item><item><title>How to identify your SQL Server version and edition</title><link>https://blog.wapnet.nl/2011/04/how-to-identify-your-sql-server-version-and-edition/</link><pubDate>Fri, 22 Apr 2011 13:26:18 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=560</guid><description>&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;SELECT SERVERPROPERTY(&amp;#39;productversion&amp;#39;), SERVERPROPERTY (&amp;#39;productlevel&amp;#39;), SERVERPROPERTY (&amp;#39;edition&amp;#39;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;</description></item><item><title>Check SQL Log space use</title><link>https://blog.wapnet.nl/2010/10/check-sql-log-space-use/</link><pubDate>Tue, 19 Oct 2010 14:24:35 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=435</guid><description>&lt;p&gt;DBCC SQLPERF(LOGSPACE);
GO&lt;/p&gt;</description></item><item><title>mysql restore (under Windows)</title><link>https://blog.wapnet.nl/2009/01/mysql-restore-under-windows/</link><pubDate>Wed, 14 Jan 2009 20:05:47 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=170</guid><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you want to use mysqldump to back up the database, you can enter the full path when typing the command, or add the path c:\wamp\bin\mysql\mysql5.0.51b\bin to the System variable PATH in Control Panel - System - Advanced - Environment Variables - System variables.&lt;/p&gt;
&lt;p&gt;You can make a backup from the command line or a scheduled task in Windows like this, assuming that myusername and mypassword have access to the database mydatabase:&lt;/p&gt;</description></item><item><title>How to shrink a SQL Transaction Log</title><link>https://blog.wapnet.nl/2008/02/how-to-shrink-a-sql-transaction-log/</link><pubDate>Wed, 20 Feb 2008 16:19:32 +0000</pubDate><guid isPermaLink="false">https://blog.wapnet.nl/?p=18</guid><description>&lt;p&gt;For 2005:
--\* you can get the logical log file name usingthe following command in Query Analizer:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;exec&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;databaseName&amp;#34;&lt;/span&gt;.dbo.sp_helpfile
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now execute the following command to shrink the database log to 200MB:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;DBCC SHRINKFILE (&lt;span style="color:#e6db74"&gt;&amp;#34;logicalLogFileName&amp;#34;&lt;/span&gt;, &lt;span style="color:#ae81ff"&gt;200&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;BACKUP LOG &lt;span style="color:#e6db74"&gt;&amp;#34;databaseName&amp;#34;&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;WITH&lt;/span&gt; TRUNCATE_ONLY
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;DBCC SHRINKFILE (&lt;span style="color:#e6db74"&gt;&amp;#34;logicalLogFileName&amp;#34;&lt;/span&gt;, &lt;span style="color:#ae81ff"&gt;200&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;ndash;if it doesn&amp;rsquo;t work, run the two commands again.&lt;/p&gt;
&lt;p&gt;&amp;ndash;When done with that, do a full backup of your db as you will have broken your tlog backup chain.&lt;/p&gt;
&lt;p&gt;For 2008+&lt;/p&gt;</description></item></channel></rss>