If you are community player or even you want to present something to someone, you may need to zoom in and zoom out certain area of your presentations to make the audience clear about your key areas. I always find it difficult if I share a screen with someone on explaining things and showing it to them. Power point presentation has an option to zoom-in and zoom-out, however, this cannot be applied for other software like SSMS etc. Today, let us quickly see some of the options that could help us in similar situations.
There is a default option in SSMS to zoom out, however, its applicable for only Query part as below:
If you need something for results or any other area, then there is no default way of achieving in SSMS. To support in such situation, I would like to introduce a tool called Zoomit by Microsoft. You can download the tool from the below link:
At times, we may need to run SQL files present in a folder against SQL Server Database. Since there are no built in feature available as of now, here is our try with a powershell script.
Save the (.bat) Batch script & (.ps1) PS Script in same folder in which all the SQL Files are stored.
The Machine should have the SQL Server instance and Power shell tool.
Ensure the parameters values are verified in (.bat) Batch file
i) All key values are handled with parameters ii) If database not exist it will throw error and comes out of PS iii) If any script has issues/failed, it will throw error and comes out of PS iv) If we want to run the sql scripts in subfolder as well, then “Includesubfolders” parameter set to 1 v) Batch file automatically retrieve the root path
CD /D "%PowerShellDir%"
Powershell -ExecutionPolicy Bypass -Command "& '%PSScript%' '%path%' '%machine%' '%db%' '%user%' '%pwd%' '%Includesubfolders%'"
If Database Not Exists:
If Database Exists:
If Any Script has Error:
If “Includesubfolders” parameters set to “1”
I’d like to grow my readership. If you enjoyed this blog post, please share it with your friends!
These days it has become necessary to execute the performance test at low cost. This blog details about the how to setup “On-Demand & low cost” Performance test rig on Azure and execute performance test with it.
Primarily, to setup the on-demand performance test rig below are the prerequisites
JMeter scripts needs to be check-in to GIT Repo and keep it updated
Azure Subscriptions with the Resource Group created in which the on-demand test rig will be created.
Azure container Registry (ACR) – The JMeter docker image will be stored here
There may be some situation where you want to find the list of all filenames whose patterns are like “*.txt”, “File*.csv”, “*.html”.., etc. In such scenario you can use the below command shell scripts to get the desired results which you are looking for.
1) To get the list of all filenames and folder names present in a folder “C:\testdata\”
dir /b /s
2) To get all the filenames of pattern “*.txt” or “*.html” from folder “C:\testdata\”
dir /b /s "*.txt"
dir /b /s "*.html"
3) To get all the filenames of pattern “*.txt” from folder “C:\testdata\” and store the corresponding results in the text document
dir /b /s "*.txt" > output.txt
dir /b /s "*.txt" > "c:\testdata\test\outputs.txt"
Its not a SQL Server related, but I found it difficult to identify a way to get the NetBIOS name of a computer, hence sharing the same.
Recently, while troubleshooting an issue with MSDTC, I had to use DTCPing tool. I do not cover the DTCPing tool here, but will share more about it in another post. DTCPing tool was expecting NetBIOS name instead of IP address.
So, here are few options to identify the NetBIOS Name of a computer.
exec master..xp_regread 'HKEY_LOCAL_Machine', 'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\','ComputerName'
nbtstat -n (-n -- Lists local NetBIOS names.)
Thats it for now, but if you think there is any other method, post it in the comment section.
This site discusses and shares thoughts and experiences in SQL Server.