Blog

USE of GO in SQL Server

GO is interpreted by SQL Server utilities as a signal to deliver the current batch of Transact-SQL statements to a SQL Server instance. All statements entered since the last GO, or since the beginning of the ad hoc session or script if this is the first GO, make up the current batch of statements. To…

Can we convert TIMESTAMP to date time?

The short answer is, NO. Let’s consider the following example. USE testDB GO CREATE TABLE tbOrders ( iOrderID INT IDENTITY(1,1) PRIMARY KEY, dtOrderDate DATETIME, dcPaidAmount Decimal(9,2), TIMESTAMP ); INSERT INTO tbOrders(dtOrderDate, dcPaidAmount) VALUES (‘2023-11-01’, 2750), (‘2023-11-02’, 3950), (‘2023-11-03’, 7000); Now retrieve the data and see the results. SELECT * FROM tbOrders The timestamp values assigned…

Stored Procedure – RAISERROR

Here’s an example of how to make a user-defined error message and raise it in the event that something goes wrong. — Creating the procedure CREATE PROCEDURE uspUpdateValue AS BEGIN TRY DECLARE @ErrorMsg VARCHAR(100) DECLARE @ErrorMessage VARCHAR(100) DECLARE @Severity INT DECLARE @State INT SET @Severity = 10 SET @State = 1 SET @ErrorMessage = ‘An…

MySQLDump Backup and Restore All Databases at once

The mysqldump client utility performs logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It dumps one or more MySQL databases for backup or transfer to another server. The mysqldump command can also generate output in CSV, other delimited text, or XML…

Assign a serial number to result set – MySQL

Concerned parties may occasionally request that a serial number be displayed alongside the result set when a report is being generated. If the table lacks an auto-increment column or the result-set is lacking a unique identifier, you can assign one dynamically using the method outlined below. — Sample datasetCREATE TABLE tbCustomer (    CustName VARCHAR(45) NOT…

Generate SubOrder ID to Orders MySQL

To differentiate between OrderIDs that are identical, it is suggested to include a SubOrderID as an additional field with a serial number suffix. For example, in the event that the OrderID is 100123 and is repeated twice, the SubOrderID values in the additional column should be 1001231 and 1001232. — Sample dataset CREATE TABLE tbOrders(…

Anonymity with Random Values in MySQL

Organisations can use data anonymization as a strategy to abide by strict data privacy rules that require the protection of personally identifiable information (PII), such as date of births, emails, identification details, monetary information, contact information, and information from health reports. The following will assist in making the data anonymous. 1) Updating random values for…

SQL Sample Datasets and Assignments

Here is a compilation of earlier blog posts that were relevant to Sample datasets, Sample projects, and Sample assignments. For quick reference only.  

MySQL Administration

The articles about MySQL administration that have previously been posted on this blog are listed below. For quick reference only.

Hadoop Default Ports

Computers are able to distinguish between various traffic types with the use of ports. A default open port is a port number that is preconfigured to accept internet connections and packets from specific services using protocols like the User Datagram Protocol (UDP), Stream Control Transmission Protocol (SCTP), Datagram Congestion Control Protocol (DCCP), or Transmission Control…

Loading…

Something went wrong. Please refresh the page and/or try again.


Follow My Blog

Get new content delivered directly to your inbox.