This is a quick guide on how to check which features are installed on a SQL Server.
Open your SQL Server installation files. You may find them within the Setup Bootstrap folder (“C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\SQL2019”) or you might already have the ISO handy.
The SQL Server discovery report is saved to %ProgramFiles%\MicrosoftSQL Server\nnn\Setup Bootstrap\Log\<last Setup Session>.
‘nnn’ is whatever version of SQL Server you have: # SQL Server 2012 (110) # SQL Server 2014 (120) # SQL Server 2016 (130) # SQL Server 2016 (130) # SQL Server 2017 (140) # SQL Server 2019 (150)
If you’re using PowerShell, Get-Content will work… tab your way through the sub-folders.
The highlighted area above shows only the Database Engine Services are installed of SQL Server 2019 Developer Edition.
In order to join a Windows Server to a domain, you may need to request that the network team open certain firewall rules. The network requirements for this process can be complex and may vary depending on your specific environment.
After joining a domain, especially in a new environment, it is important to perform some checks to ensure everything is working correctly. These checks may include using GPResult and GPUpdate to update and verify Computer and User Policies, using Nltest to perform network administrative tasks such as querying domain controllers and trust relationships, and reviewing the Windows Event Viewer for any issues.
After joining a Windows Server to a domain, you can use the gpupdate command to check if the domain join is healthy. This command updates Computer and User Policies on the server, and can help to ensure that the server is properly configured and communicating with the domain controller.
Here is an example of running gpupdate:
We can also have a look at applied Computer policies using the /v parameter when running gpresult.
Nltest
Nltest.exe is a command-line tool that allows you to perform network administrative tasks, including querying and testing the status of domain controllers and trust relationships. Some examples of the tasks that you can perform with Nltest include:
nltest /dclist:<domain> lists all the domain controllers in the domain.
nltest /dsgetdc:<domain> queries DNS and returns a list of domain controllers (with IPs).
nltest /dsgetsite returns the site name of the domain controller.
nltest /sc_query:<domain> reports the state of the secure channel for when it was last used.
Windows Event Viewer
The Windows Event Viewer is a useful tool for viewing and managing events that are recorded by Windows operating systems. While not all events recorded in the Event Viewer require investigation, it is important to pay attention to errors and critical events, especially during the domain join process.
This blog post is a guide on how to create databases and tables in MySQL, from a Windows and Linux computer. The information included here should help beginners who are new to MySQL.
To create a new database in MySQL, and many other relational database systems we use the CREATE DATABASE SQL Statement.
The meaning behind the word ‘database’ can vary, and often be referred to the same thing as a Schema. In MySQL, Databases and Schemas are both one of the same things.
We can create a MySQL Database by running CREATE DATABASE databaseName
The create database example below is being done using the GUI option, MySQL WorkBench. For more information on SQL syntax and parameters of the CREATE DATABASE statement in MySQL, we can refer to the MySQL Dev Docs.
After running the above, refresh Schemas within the Navigator to the left and open the new database.
If you’re instance running on Linux, database names are case-sensitive, whereas on Windows this isn’t an issue. Below, I’m creating a database on a local MySQL install (Windows 10) and then creating a MySQL table within it using a Capital letter on the schema/database name.
The above is us logging in with the ec2-user to an Amazon Linux EC2 instance. Then we create a new table using a Capital letter on the database schema name.
A common best practice is to stick to the one case for object naming in SQL for this reason. For example, use finance_database instead of Finance_Database, or use FINANCE_DATABASE.
The USE DATABASE command in SQL is used to set your statements to use the specified database as your default (current) database.
To show an example of USE in SQL, I create a new database and table MySQL Workbench below. The CREATE TABLE and INSERT INTO statements include the schema name (butter), and then I attempt to run a SELECT statement on the table without including the schema name.
The returns an error – Error Code: 1046. No database selected. Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar.
As described in this error message, we can set our default schema in the MySQL Workbench Navigator.
That’s one solution. The other is to use the USE DATABASE statement. I’m adding USE butter; to the TSQL in the MySQL Workbench query window.
All queries executed after running the USE command will assume the database specified when running queries without a schema name.
Semicolons are a way to determine when your SQL statement ends in MySQL.
A query does not run by hitting return in a MySQL terminal, it requires a semicolon to know when the SQL statement is complete.
The screenshot below shows a Linux client connected to MySQL. The first command includes a semicolon and returns a list of databases. The second command (DROP DATABASE) displays the example of a command not being executed.
The command does not run until we add a semicolon and hit return, as marked with a red cross on the screenshot.
To further help understand semicolons in MySQL I also will show an example in MySQL Workbench. I’m creating a new table and inserting a row of data into the table on the next row.
The CREATE TABLE statement returns an error message – Error Code: 1064: You have an error in your SQL syntax; check the manual that the corresponds to your MySQL...
The table did not get created here. If I add the semicolon at the end of the CREATE TABLE line the table will get created and a row will be inserted.
If you’re running queries line-by-line then the semicolon isn’t as much required. For more information, see this MySQL documentation link.
When your machine is upgraded to a newer version of Windows, it leaves behind a C:\Windows.old directory which can be quite large.
It contains the backup of the previous Windows version, so
if you plan on deleting it you’re saying goodbye to the rollback option.
If do you try delete it, you’ll likely encounter the following…
Try again please…
We can remove this by running Disk Cleanup.
Click Clean up system files.
(might take a sec)
Select Previous Windows installation(s) and click OK.
You are sure, so click to Delete Files on the above prompt.
As mentioned, if you delete these files you’ll lose the ability to restore back to the previous version of Windows. You’d peer check before going ahead with this in the workplace.
It might take a good 5 minutes or so.
When it finishes you should see the Windows.old files
disappear and the disk space be freed!
This is a post on installing SQL Server via command; I have a Windows Server 2016 Core running on a local Hyper-V test environment, and I’m installing SQL Server 2019, then uninstalling it.
As this is on my test environment, I’m installing the most
recent SQL Server Edition available, which is SQL Server 2019 CTP 2.4 at the
time of writing.
SQL Server 2019 can be downloaded here – Open it up and select to download the media.
ISO’s are good for local virtual environments (using HyperV
here).
6Mbps…
We’re now ready to get that ISO mounted.
Mount the ISO on a Hyper-V Virtual Machine
1. Click Media > Insert Disk…
2. Select the ISO file.
Install SQL Server via Command
1. First, lets have a look at our drives using the Get-PSDrive
cmdlet.
2. Install using your preferred parameters. I’m adding the Domain Admins group as Sysadmins for quickness.
The above shows the result of the installation was successful, and other things like where the Configuration INI file is (used for Unattended Installs).
4. Next, we should check the SQL Server services, using Get-Service with “SQL” wrapped in wildcards.
Uninstall SQL Server via Command
Uninstalling is as simple as the install, funnily enough..
Once it’s done, we can check the summary file status and services to quickly verify the uninstallation has not been unsuccessful.
Windows Server Core is the CLI only version of the Windows
OS. This post is a run-through of configuring a new Windows Server 2016 Core host,
detailed in the following steps;
The private IPv4 network has been configured, now we should verify we have line-of-sight.
Joining a Windows Server to a Domain
To join a Windows OS to the domain, we can use the Add-Computer cmtlet – You’ll immediately be prompted for authorisation from an account that can join computers to the domain.
Enter the Domain Name.
Reboot once done.
When the box is up, you’ll have the option to login with the
Local Administrator account, or with another user.
If selecting Other user, you’ll have an entry for the domain
you’re signing into.
Joining a Windows Computer to Active Directory Domain Services is required in 99% of Corporate environments, and is usually a Systems Administrator task to configure at the Domain Controller side. Adding a computer to AD allows your computer to be administered via Group Policies that can be applied to all remote computers globally within your company. This helps companies lock down computers and roll out new software or updates.
I’m creating a new user account for me to carry out all changes required to set up my lab. It’ll be a new OU in AD, create a new user account and then add it to the Domain Admin group.
1. Right-click the Domain Name within Active Directory Users and Computers, select New and Organisational Unit:
2. Enter the new OU name – I’m going to pretend I’m in the IT Department:
3. Within the IT OU, right-click and select New-User:
4. Enter new user details:
5. Enter password stuff:
6. Finish:
7. Right-click the new user and select Add to a group:
8. Enter king group, Domain Admins:
Joining a Windows Server to a Domain
1. First, I have to get onto the same private IP range as the DC:
2. Within Server Manager, click the Computer name link:
3. Click Change:
4. Amend the hostname and enter the Domain name:
5. Enter credentials for an account that can join the domain (the account created above within this post would also work):
6. When the server next boots up a domain user account can log in: