Dealing with Parameter Sniffing in SQL Server
Categories
- Free tools
- SQL Compliance Manager
- SQL Defrag Manager
- SQL Diagnostic Manager for MySQL
- SQL Diagnostic Manager for SQL Server
- SQL Diagnostic Manager Pro
- SQL Inventory Manager
- SQL Query Tuner for SQL Server
- SQL Safe Backup
- SQL Secure
- SQL Workload Analysis for SQL Server
- Uptime Infrastructure Monitor Formerly Uptime
Chapter 18. WMI: Windows Management Instrumentation
Windows Management Instrumentation (WMI) is a technique available on all Windows systems starting with Windows 2000. WMI can provide you with a wealth of information…
Stripping Decimals Without Rounding
Extracting the Integer Part of a Division Result When you divide numbers and just want the decimals before the decimal point, you could cast the result to integer. However, this would also round the result: PS> 18 / 5 3.6 PS> [Int](18/5) 4 Removing Decimals...
Removing Multiple White Spaces
Removing multiple white spaces from text is easy in PowerShell. -replace operator Simply use -replace operator and look for whitespaces ("\s") that occur one or more time ("+"), then replace them all with just one whitespace: PS> '[ Man, it works! ]' -replace...
Sending Emails with Special Characters
Send Emails with PowerShell Using Send-MailMessage PowerShell has built-in support for sending emails: Send-MailMessage! All you need is an SMTP server. However, with standard encoding you may run into issues where special characters are mangled. -Encoding parameter...
Ignoring Empty Lines
Reading Text Files and Skipping Blank Lines To read in a text file and skip blank lines, try this: $file = 'c:\sometextfile.txt' Get-Content $file | Where-Object { $_.Trim() -ne '' } It will omit empty lines, lines with only blanks and lines with only tabs. ReTweet...
Writing Registry Key Default Values
Set the default value for a registry key If you need to set the default value for a registry key, you can use either of these approaches: Set-ItemProperty -Path HKCU:\Software\Somekey -Name ‘(Default)’ -Value MyValue Or, you can just do this: Set-Item -Path...
How to Fix Aqua Data Studio Crashes and Unstable Behavior
Aqua Data Studio is crashing, not responding, or showing other signs of unstable behavior. Response Jonathan Powers over 11 years ago Unstable Behavior and Crashes Using ADS JRE-related Issues Please make sure to run ADS with the bundled JRE. ADS requires the Oracle...
Aqua Data Studio is running out of memory. How do I increase it?
Aqua Data Studio is running out of memory. How do I increase it? Response Jonathan Powers over 11 years ago Memory Allocation in Aqua Data Studio If Aqua Data Studio crashes, becomes unresponsive, or displays no output when querying for a large amount of data, it has...
Aqua Data Studio gets disconnected after a certain period of time.
Aqua Data Studio gets disconnected after a certain period of time. Response Tariq Rahiman over 11 years ago Timeouts: ADS periodically gets disconnected from the server Aqua Data Studio does not timeout user connections. However, many DBAs configure the database...
How do I connect to Teradata with LDAP?
How do I connect to Teradata with LDAP authentication using Aqua Data Studio? Response Niels Gron over 11 years ago The authentication mechanism for a database server login is controlled by the JDBC driver of the vendor. Each vendor has non-standard properties for...
HTML-Scraping with RegEx
Scraping Website Data with PowerShell To scrape valuable information from websites with PowerShell you can download the HTML code and then use regular expressions to extract what you are after. That's not hard. Here is a sample: $webclient = New-Object...
Case-Sensitive Hash Tables
PowerShell hash tables PowerShell hash tables are, by default, not case sensitive: PS > $hash = @{} PS > $hash.Key = 1 PS > $hash.keY = 2 PS > $hash.KEY 2 Creating Case-Sensitive Hash Tables in PowerShell If you need case-sensitive keys, you can create the...
Making sure PowerShell scripts run in 32-bit
Dealing with 32-bit Dependencies in a 64-bit Environment If you are using code that can only run in a 32-bit environment (i.e. using old database drivers or COM objects), here is a solution that will re-launch the script in a 32-bit PowerShell when it is launched in a...
Configuring WSMan Remotely for multiple computers
When working remotely in a peer-to-peer or cross-domain scenario, you will have to add all the computers you'd like to communicate with into the trusted hosts list. Overwriting Issue When Adding Trusted Hosts Unfortunately, when you try this, any new entry will...
Getting Process Based On Window Title
Identifying a Process by Window Title It isn't always easy to pick the right process because the process ID or process name may not be known or ambiguous. If the process has a window and you can see the window title, all you need to do is search for a keyword in that...
Checking Whether Hash Table Contains Key
Understanding the Limitation of Hash Tables Compared to Switch Statements In the previous tip, you used a hash table to translate input values. However, unlike Switch-statements, Hash Tables have no "default" so all values need to be present in the hash table. Check...
List Hidden Files
Did you notice that Dir, ls or Get-ChildItem do not return hidden files? Use the -Force Parameter to Reveal Hidden Files To see hidden files, you need to specify the -force parameter: Dir $env:windir -force Filter to Show Only Hidden Files But what if you just wanted...
Calling VBScript From PowerShell
Sometimes, you may have an existing VBScript that already does just what you want. You can easily incorporate any VBScript into PowerShell because PowerShell can call just about anything that is executable, including VBScript. The tricky part is that you mainly want...
Returning Text Information From PowerShell To VBScript
In a previous tip, you learned how to call PowerShell statements and read their return value. Return values are somewhat limited because they can only be numeric. There is an easy way to do this if you'd like to read more structured information from a PowerShell call...
Encrypting PowerShell Scripts
Why Hide PowerShell Script Code? Sometimes, you may want to hide the code of your PowerShell script in order to protect passwords contained within the code. One way to safely encrypt PowerShell script is by converting it into a secure string. You must first create a...