European Windows 2019 Hosting BLOG

BLOG about Windows 2019 Hosting and SQL 2019 Hosting - Dedicated to European Windows Hosting Customer

European SQL Server 2022 Hosting :: Comparing SQL Server and Oracle Query Types by Category

clock June 24, 2025 08:08 by author Peter

This comprehensive reference manual compares and classifies the most used SQL queries in Oracle and SQL Server, arranged by:

  • DDL: Data Definition Language
  • DML: Data Manipulation Language
  • TCL: Transaction Control Language
  • DCL: Data Control Language
  • DQL: Data Query Language

1. DDL – Data Definition Language
Used for defining or modifying database objects like tables and columns.
Oracle Syntax Oracle Syntax

Operation SQL Server Syntax Oracle Syntax
Create Table CREATE TABLE table_name (col1 INT, col2 VARCHAR(100)); Same
Drop Table DROP TABLE table_name; Same
Add Column ALTER TABLE table_name ADD col_name datatype; Same
Drop Column ALTER TABLE table_name DROP COLUMN col_name; Same
Modify Column ALTER TABLE table_name ALTER COLUMN col_name datatype; ALTER TABLE table_name MODIFY (col_name datatype);
Rename Column EXEC sp_RENAME 'table.old', 'new', 'COLUMN'; ALTER TABLE table_name RENAME COLUMN old TO new;
Rename Table EXEC sp_RENAME 'old_table', 'new_table'; RENAME old_table TO new_table;

2. DML – Data Manipulation Language
Used for managing the data within tables.

Oracle Syntax Oracle Syntax

Operation SQL Server Syntax Oracle Syntax
Insert INSERT INTO table_name VALUES (...); Same
Update UPDATE table_name SET col = val WHERE ...; Same
Delete DELETE FROM table_name WHERE ...; Same
Merge (Upsert) MERGE INTO target USING source ON (condition) Same
Truncate TRUNCATE TABLE table_name; Same

3. TCL – Transaction Control Language
Used to manage changes made by DML operations.

Operation SQL Server Syntax Oracle Syntax
Begin Transaction BEGIN TRAN; BEGIN; or auto (depending)
Commit COMMIT; COMMIT;
Rollback ROLLBACK; ROLLBACK;
Savepoint SAVE TRAN save_name; SAVEPOINT sp_name;
Rollback to Savepoint ROLLBACK TRAN save_name; ROLLBACK TO sp_name;

4. DCL – Data Control Language
Used to control access and privileges on database objects.

Operation SQL Server Syntax Oracle Syntax
Grant Privileges GRANT SELECT ON table TO user; Same
Revoke Privileges REVOKE SELECT ON table FROM user; Same
Create User CREATE LOGIN user WITH PASSWORD = 'pwd';
CREATE USER user FOR LOGIN user;
CREATE USER user IDENTIFIED BY pwd;
Assign Role ALTER ROLE role_name ADD MEMBER user; GRANT role_name TO user;

5. DQL – Data Query Language
Used to query data from tables.

Operation SQL Server Syntax Oracle Syntax
Select All SELECT * FROM table_name; Same
Select with WHERE SELECT * FROM table_name WHERE condition; Same
Order By SELECT * FROM table ORDER BY col DESC; Same
LIKE Clause SELECT * FROM table WHERE col LIKE 'A%'; Same
Top Rows SELECT TOP 5 * FROM table; SELECT * FROM table WHERE ROWNUM <= 5;
Aggregate Functions SELECT COUNT(*), AVG(col) FROM table; Same
Group By SELECT col, COUNT(*) FROM table GROUP BY col; Same

Bonus Query Comparisons

Purpose SQL Server Example Oracle Example
Backup Table SELECT * INTO backup FROM original; CREATE TABLE backup AS SELECT * FROM original;
Insert from SELECT INSERT INTO t2 SELECT * FROM t1; Same
Check Procedure Exists SELECT * FROM sys.objects WHERE name='proc'; SELECT * FROM user_objects WHERE object_name='PROC';
Hex to Text Conversion SELECT CONVERT(VARCHAR(50), 0x48656C6C6F); UTL_RAW.CAST_TO_VARCHAR2('48656C6C6F');
Execute Procedure (XML) EXEC ProcName 'XML'; BEGIN ProcName('XML'); END;

Summary Table – SQL Query Categories

Category Full Form Common Operations
DDL Data Definition Language CREATE, ALTER, DROP
DML Data Manipulation Language INSERT, UPDATE, DELETE, MERGE
TCL Transaction Control Language COMMIT, ROLLBACK, SAVEPOINT
DCL Data Control Language GRANT, REVOKE, CREATE USER, ROLES
DQL Data Query Language SELECT, WHERE, ORDER BY, GROUP BY

HostForLIFEASP.NET SQL Server 2022 Hosting



European SQL Server 2022 Hosting :: How to Install and Configure SQL Server 2025 in Windows?

clock June 13, 2025 10:36 by author Peter

Microsoft created SQL Server 2025, a potent relational database management system (RDBMS) ideal for database applications at the enterprise level. If you properly follow the instructions, installing SQL Server 2025 on a Windows computer is simple.

System Requirements
Make sure your system meets the following requirements before proceeding:

  • Operating System: Windows 10, Windows Server 2019, or higher
  • Processor: Minimum 2 GHz; recommended multi-core processor
  • RAM: Minimum 4 GB; recommended 8 GB or higher
  • Disk Space: At least 10 GB of free space
  • .NET Framework: Version 4.8 or higher

Step-by-Step Installation
Step 1: Download SQL Server 2025

Visit the official Microsoft website and navigate to the SQL Server 2025 download page. Choose the appropriate version (Standard, Enterprise, or Developer) based on your needs, and download the installation package. Or click here to download SQL Server 2025, then fill out the form below to download the SQL Server 2025 public preview version.

Then the SQL Server Media file will download as shown in the snapshot below.

Step 2: Launch the Installer
Once the download is complete:

  • Locate the installer file in the download folder (file name = SQL2025-SSEI-Eval.exe).
  • Right-click on the file and select Run as Administrator to ensure proper installation. 

Step 3: Choose Installation Type
The installation wizard will prompt you to select the type of installation:

  • Basic Installation: Recommended for beginners or small-scale projects.
  • Custom Installation: Allows you to choose specific features and settings.
  • Here I am selecting Basic for now, as shown in the snapshot below.

For most users, selecting Custom Installation provides the flexibility needed to tailor the installation to their environment. Then select Agree to accept the Microsoft SQL Server License Terms.

Then choose the installation location. For now, I am keeping the default installation path, which is C:\Program Files\Microsoft SQL Server, and click on the Install button. Then, the download and install package will begin as shown in the snapshot below. It may take a few minutes, depending on your internet speed. Once the download finishes, installation will start automatically. Just wait for a few minutes.

Step 4: Configure Instance
During installation:

  • Choose between a Default Instance or a Named Instance.
  • A Default Instance is typically named MSSQLSERVER and works for general purposes.
  • Named Instances are useful for running multiple SQL Server versions on the same machine.

If SSMS is already installed, then click on connect now, or click on the close button, then connect in SSMS, or if SSMS is not installed already, then click on install SSMS, or follow my other article to learn about What is SQL Server Management Studio (SSMS) and How to install SSMS in Windows. Or if you are installing SQL Server for the first time on your machine, then follow the steps mentioned below.

Step 5: Set Up Server Configuration
The wizard will ask for server configuration details:

  • Specify the Authentication Mode:
  • Windows Authentication: Recommended for integration with Windows accounts.
  • Mixed Mode: Allows both Windows and SQL Server authentication.

Provide a strong password for the system administrator (SA) account if using Mixed Mode.

Step 6: Select Features
Choose the features you wish to install:

  • Database Engine Services: For managing databases.
  • Analysis Services: For data analytics.
  • Reporting Services: For generating reports.
  • Integration Services: For ETL processes.

Make sure to only select the features that are relevant to your project to save system resources, and then click on the next button as shown in the snapshot below.

Step 7: Installation Progress
Once all configurations are set, the installer will begin installing SQL Server 2025. This process may take several minutes. Monitor the progress bar and ensure the installation completes without errors.

Step 8: Verify Installation
After installation:

Open SQL Server Management Studio (SSMS) or a similar tool.
Connect to the newly installed SQL Server instance using your credentials.
Run a simple query to test database functionality.

Conclusion
Following these steps will help you install SQL Server 2025 successfully on a Windows system. Make sure to keep software and drivers up to date for optimal performance and security. If you require any clarification/suggestions on the article, please leave your questions and thoughts in the comment section below. Follow C# Corner to learn more new and amazing things about SQL or to explore more technologies. Thanks for reading, and I hope you like it.

HostForLIFEASP.NET SQL Server 2022 Hosting



European SQL Server 2022 Hosting :: In SQL, Horizontal vs Vertical Partitioning

clock June 5, 2025 09:49 by author Peter

It gets harder to maintain performance and scalability as databases get bigger and more complex. In order to optimize query performance and facilitate effective data organization, partitioning is a commonly used technique that divides data into digestible chunks. Developers and DBAs sometimes struggle to decide between vertical and horizontal partitioning when creating partitioning techniques. Depending on the use situation, each strategy has specific benefits and drawbacks. This post will discuss the distinctions between vertical and horizontal partitioning, look at actual use cases, and emphasize how each technique affects performance. You will have the information necessary to select the best partitioning strategy for your SQL database by the end of this session.

What is Partitioning in SQL?
Partitioning is the act of dividing a large database table into smaller, more manageable pieces called "partitions." These partitions allow the database engine to perform operations on a subset of data rather than the entire table, leading to improved performance and scalability.

Partitioning is often used in,

  • OLTP (Online Transaction Processing) systems to handle high transactional workloads.
  • OLAP (Online Analytical Processing) systems to optimize complex aggregations and queries on large datasets.

Partitioning can be implemented as either horizontal or vertical, each catering to specific requirements.

Horizontal Partitioning
Definition
Horizontal partitioning refers to splitting rows of a table across multiple partitions. Each partition contains a subset of records based on a defined range, list, or hash function. All columns from the original table remain in each partition, but the rows are distributed across partitions.

How does it work?

The key criterion for horizontal partitioning is a partitioning key—a column used to determine which partition a row should belong to. For example,

  • A range partition might store rows based on values such as year.
  • A list partition could separate rows based on region or department.

Example
Let’s consider a table SalesData with 10 million rows, containing sales records grouped by years. If we partition the table horizontally based on a RANGE of years, the schema could look like.
    Partition 1: Records for the year 2020
    Partition 2: Records for the year 2021
    Partition 3: Records for the year 2022


-- Create Partition Function
CREATE PARTITION FUNCTION SalesPartitionFunction(INT)
AS RANGE LEFT FOR VALUES (2020, 2021, 2022);

-- Create Partition Scheme
CREATE PARTITION SCHEME SalesPartitionScheme
AS PARTITION SalesPartitionFunction
ALL TO ([PRIMARY]);

-- Create a table using the above partition scheme
CREATE TABLE SalesData (
    SaleID INT,
    Year INT,
    Amount DECIMAL(10, 2),
    PRIMARY KEY (Year, SaleID) -- Include partitioning column in the PRIMARY KEY
) ON SalesPartitionScheme (Year);

Use Cases for Horizontal Partitioning
Time-Based Data: Partitioning logs, transactions, or sales data grouped by date or year allows efficient range queries.

  • Example Query: Retrieve sales data only for 2022.
  • Geographically Distributed Data: Partition by region or country for organizations with distributed offices.
  • Example Query: Retrieve records only for the Europe region.
  • Scalability in Distributed Systems: Horizontal partitioning can distribute partitions across multiple servers (a process often referred to as sharding) to facilitate scaling.

Performance Impact
Query Optimization: Query performance improves since SQL Server can scan only relevant partitions instead of the full table. For example, sql
SELECT * FROM SalesData WHERE Year = 2022;

  • The database engine will scan just the 2022 partition.
  • Reduced I/O: By accessing smaller subsets of rows, the number of disk reads and memory usage is significantly reduced.
  • Parallel Processing: Partitioned data enables better parallelism, where queries can operate on multiple partitions simultaneously.

Vertical Partitioning
Definition

Vertical partitioning splits a table’s columns into multiple tables or entities. Each partition contains a subset of the columns from the original table, often leaving shared columns (like primary keys) in both partitions for reference.

How does it work?

Vertical partitioning is useful for scenarios where certain sets of columns in a table are accessed frequently, while others are rarely used. In this strategy, the table is divided into smaller tables to isolate rarely accessed columns.

Example
Consider a customer management table, CustomerData, containing demographic information (e.g., name, address) as well as financial records (e.g., account balance, credit score). If only the demographic data is frequently queried, we can split the table vertically like this.

Original Table
CREATE TABLE CustomerData (
    CustomerID INT PRIMARY KEY,
    Name VARCHAR(100),
    Address VARCHAR(200),
    CreditScore INT,
    Balance DECIMAL(10, 2)
);


After Vertical Partitioning
CREATE TABLE CustomerDemographics (
    CustomerID INT PRIMARY KEY,
    Name VARCHAR(100),
    Address VARCHAR(200)
);

CREATE TABLE CustomerFinancials (
    CustomerID INT PRIMARY KEY,
    CreditScore INT,
    Balance DECIMAL(10, 2)
);


Use Cases for Vertical Partitioning

  • Rarely Accessed Columns: Columns that are used occasionally or only by specific applications can be moved to a separate table to minimize memory overhead when querying frequently accessed columns.
  • Example: CreditScore and Balance are rarely accessed; partition them into CustomerFinancials.
  • OLTP Optimization: In transactional systems, tables accessed frequently by concurrent users may benefit from reduced memory footprint and decreased cache contention by splitting into smaller entities.
  • Security or Compliance: Sensitive data (e.g., financial records or personally identifiable information) can be stored in separate tables, simplifying access control

Performance Impact

  • Improved Query Performance: Queries on smaller tables (e.g., CustomerDemographics) are faster because they involve fewer data pages, particularly for commonly accessed columns.
  • Reduced Lock Contention: Splitting tables can minimize contention and improve concurrency, as fewer rows will be affected during updates.
  • Reduced Memory Usage: Less frequently accessed columns will not consume buffer memory, reducing the overall database’s memory footprint.

Key Differences: Horizontal vs Vertical Partitioning

Aspect Horizontal Partitioning Vertical Partitioning
Definition Break rows into partitions based on a range, list, or hash. Split columns into separate partitions/tables.
Target Data Units Rows Columns
Use Cases Time-based data, geographically distributed data, and sharding. Isolating rarely used columns, OLTP optimization, and security.
Performance Goal Minimize disk I/O during row scans. Minimize memory usage and lock contention.
Complexity Can involve partition schemes and functions. Relational integrity between partitioned tables requires additional joins.

Choosing the Right Partitioning Strategy

  • When deciding between horizontal and vertical partitioning, consider the following.
  • Large Tables with Historical Data: Use horizontal partitioning for scenarios like transaction logs or sales records grouped by date. This reduces I/O operations and improves range query optimization.
  • Frequently Accessed vs Rarely Accessed Columns: Use vertical partitioning when a table has columns accessed at vastly different frequencies. Split the table to isolate data that can be queried independently.
  • Distributed Database Design: Use horizontal partitioning for sharding across distributed environments, assigning partitions to specific servers to scale out.
  • Security Compliance: Use vertical partitioning to segregate sensitive columns into their own tables, simplifying access control policies.

Scalability and Maintenance Considerations

  • Horizontal Partitioning: Offers better scalability for large datasets but requires careful design to ensure balanced distribution. Maintenance tasks like partition splits or merges generally involve significant I/O overhead.
  • Vertical Partitioning: While easier to maintain, frequent joins between partitions can hurt performance, especially in read-heavy workloads where all data is accessed simultaneously.

Real-World Example
Horizontal Partitioning in a Time-Series Database
An e-commerce website records page views grouped by day. Queries often analyze activity trends for specific days or weeks.
Solution: Partition the PageViews table horizontally by Date.

CREATE PARTITION FUNCTION PageViewsPartition(Date)
AS RANGE LEFT FOR VALUES ('2023-01-01', '2023-02-01', '2023-03-01');


Vertical Partitioning in an OLTP Database
A hospital system stores patient demographics and medical records in a single large table. Medical data is rarely accessed except during reports.
Solution: Create PatientDemographic and MedicalRecords tables to isolate frequently accessed columns.
CREATE TABLE PatientDemographics (
    PatientID INT PRIMARY KEY,
    Name VARCHAR(100),
    Address VARCHAR(200)
);

CREATE TABLE MedicalRecords (
    PatientID INT PRIMARY KEY,
    Diagnosis VARCHAR(100),
    TreatmentDetails TEXT
);

Conclusion
Partitioning is a powerful tool for performance optimization in SQL databases, whether you need to scale horizontally across rows or simplify access via vertical column segmentation. Understanding the difference between horizontal and vertical partitioning, their use cases, and performance implications empowers DBAs and developers to design efficient, scalable, and maintainable databases. By analyzing your system’s query patterns, data distribution, and storage needs, you can make informed decisions on the best partitioning strategy to implement. Carefully choose the approach that aligns with your workload to ensure seamless database performance and growth!

HostForLIFEASP.NET SQL Server 2022 Hosting

 



About HostForLIFE

HostForLIFE is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2019 Hosting, ASP.NET 5 Hosting, ASP.NET MVC 6 Hosting and SQL 2019 Hosting.


Month List

Tag cloud

Sign in