The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,818 other followers

Archive for the ‘SQL Server’ Category

Visual Representation of SQL Joins – CodeProject

Posted by jpluimers on 2017/08/02

I thought I posted a reference to this a long time ago, but didn’t.

It’s one of the things I show when explaining joins to people. Sometimes I need it myself too (:

The article explains these in greater detail:

  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • OUTER JOIN
  • LEFT JOIN EXCLUDING INNER JOIN
  • RIGHT JOIN EXCLUDING INNER JOIN
  • OUTER JOIN EXCLUDING INNER JOIN

Note:

  • the opposite of INNER JOIN is not OUTER JOIN. It’s OUTERJOIN EXCLUDING INNER JOIN
  • the opposite of OUTER JOIN is empty set.

But the diagram is usually speaks for itself.

–jeroen

Source: Visual Representation of SQL Joins – CodeProject

Read the rest of this entry »

Posted in Access, Database Development, DB2, Development, Firebird, InterBase, MySQL, OracleDB, PostgreSQL, SQL, SQL Server | Leave a Comment »

Applications that scale badely on High-DPI Displays: How to Stop the Madness – via: SQLServerCentral

Posted by jpluimers on 2017/05/10

Many applications still scale badly on High-DPI displays: dialogs way too small, icons you need a microscope for, etc.

SSMS in High-DPI Displays: How to Stop the Madness – SQLServerCentral explains a great trick that works for many applications, for intance:

The trick comes down to enabling the PreferExternalManifest registry setting and then create a manual manifest for the application that forces the application to use “bitmap scaling” by basically telling it does not support “XP style DPI scaling”.

You name manifest file named after the exe and stored it in the same directory as the exe.

After that, you also have to rename the exe to a temporary name and then back in order to refresh the cache.

A quote from the trick:

In Windows Vista, you had two possible ways of scaling applications: with the first one (the default) applications were instructed to scale their objects using the scaling factor imposed by the operating system. The results, depending on the quality of the application and the Windows version, could vary a lot. Some scaled correctly, some other look very similar to what we are seeing in SSMS, with some weird-looking GUIs. In Vista, this option was called “XP style DPI scaling”.

The second option, which you could activate by unchecking the “XP style” checkbox, involved drawing the graphical components of the GUI to an off-screen buffer and then drawing them back to the display, scaling the whole thing up to the screen resolution. This option is called “bitmap scaling” and the result is a perfectly laid out GUI.

In order to enable this option in Windows 10, you need to merge this key to your registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide]
"PreferExternalManifest"=dword:00000001

Then, the application has to be decorated with a manifest file that instructs Windows to disable DPI scaling and enable bitmap scaling, by declaring the application as DPI unaware. The manifest file has to be saved in the same folder as the executable (ssms.exe) and its name must be ssms.exe.manifest. In this case, for SSMS 2014, the file path is “C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe.manifest”.

Paste this text inside the manifest file and save it in UTF8 encoding:

This “Vista style” bitmap scaling is very similar to what Apple is doing on his Retina displays, except that Apple uses a different font rendering algorithm that looks better when scaled up. If you use this technique in Windows, ClearType rendering is performed on the off-screen buffer before upscaling, so the final result might look a bit blurry.The amount of blurriness you will see depends on the scale factor you set in the control panel or in the settings app in Windows 10. Needless to say that exact pixel scaling looks better, so prefer 200% over 225% or 250% scale factors, because there is no such thing as “half pixel”.

–jeroen

Source: SSMS in High-DPI Displays: How to Stop the Madness – SQLServerCentral

Posted in Database Development, Delphi, Development, Eclipse IDE, Java, Java Platform, Software Development, SQL, SQL Server, SSMS SQL Server Management Studio | 4 Comments »

Fixing 0x858C001E error on SQL Server 2012/2014 updates

Posted by jpluimers on 2017/03/16

A long time ago I wrote about Fixing 84b40000 error on SQL Server 2008 updates (like KB2977321 and KB2285068).

The same holds for error 0x858C001E errors when updating SQL Server 2012 and 2014:

For x86 systems, ensure these directories are not compressed:

C:\Program Files\Microsoft SQL Server
C:\Program Files\Microsoft SQL Server Compact Edition

For x64 systems, ensure these directories are not compressed:

C:\Program Files\Microsoft SQL Server
C:\Program Files x86\Microsoft SQL Server
C:\Program Files x86\Microsoft SQL Server Compact Edition

Sources:

–jeroen

Posted in Database Development, Development, SQL Server, SQL Server 2012, SQL Server 2014 | Leave a Comment »

Static Code Analyzer for T-SQL – MS SQL Server. Plugs into MS SSMS and can al…

Posted by jpluimers on 2017/01/12

Static Code Analyzer for T-SQL – MS SQL Server.

Plugs into MS SSMS and can also be run from command line.It reports useful clues which you can turn/on off to your liking. http://sqlcodeguard.com/index-database-issues.html

It will spot declared but unused variables, but it appears it doesn’t do code coverage or execution path to spot stuff like variables being used without being initialized.

http://sqlcodeguard.com/ Price: Free

Source: Lars Fosdal on G+: Static Code Analyzer for T-SQL – MS SQL Server. Plugs into MS SSMS and can al…

–jeroen

Posted in Database Development, Development, SQL, SQL Server, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014 | Leave a Comment »

SQL Server, Modulo, floats

Posted by jpluimers on 2016/12/08

SQL server % (modulo, not mod) operator doesn’t like floats (with reason).

You should get rid of the floats as they will give inaccurate results.

As a workaround, cast either through an integer or through a decimal: sql server modulo float – Google Search

CAST(CAST(TheInaccurateFloatValue AS decimal(38,19)) % ModuloValue AS float)

The decimal(38,19) is the maximum non-float precision you get.

( cast(dividend as integer) % divisor ) + ( dividend - cast(dividend as integer))

–jeroen

Posted in Algorithms, Database Development, Development, Floating point handling, Software Development, SQL, SQL Server, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014 | Leave a Comment »

 
%d bloggers like this: