Posts

Showing posts from August, 2022

SQL Server 2022 RC0, new features and capabilities. The great improvement of the TRIM function, Integrated acceleration and other features

Image
Hi Guys, Service news! SQL Server 2002 RC0 (Release candidate) is out and you can download it from:   download SQL Server 2022 RC0   We already spoken about the previous CTP for example here: What is new in the CTP 2.1 of SQL Server 2022? New T-SQL commands! Now let's see what improvements are contained in this Release Candidate 0! Enjoy!    T-SQL Language improvements The TRIM() function is now able to removes the space character (ascii 32) or other specified characters from the start or end of a string. Now the syntax follow the ANSI SQL Standard TRIM ( [ LEADING | TRAILING | BOTH ] [characters FROM ] string ) Where the optional first argument specifies which side of the string to trim: LEADING removes characters specified from the start of a string. TRAILING removes characters specified from the end of a string. BOTH (default positional behavior) removes characters specified from the start and end of a string    Two simple examples     The following SELECT ... SELECT

SQL Server, How to automate a database restore

Image
Hi Guys, Today a little but (i hope) useful post! We will see how to automate the restore process of a database .    Only with T-SQL command and scheduling a Job.   Enjoy!     Automate a database restore First of all we must say that the T-SQL language has a command to perform a restore of a database.     The command is simply: RESTORE DATABASE database FROM DISK = ' nomefile ' WITH REPLACE However, sometimes the backup is created by adding the date , for example, to the name.     This makes it a more difficult to automate the procedure.     In addition, sometimes the backup of each database is stored in a different subfolder .   So, how to automate this process? Suppose having a production database (product_db) and a test database (test_db) We want to align the data into the test database with the data in the production database . What we need is the name of the last backup we have done in the production database. To do this you can read this informatio

Access to data in SQL Server from the web! a little bit of ...Javascript, Python and SQL Server

Image
Hi guys, Welcome back mates to another atypical post!   In the latest post we talk about how to access data in Microsoft SQL Server from the Python language: Python from 0 to Microsoft SQL Server! A tutorial to try step to step   Today we do a little step forward. We will see how to access our data in SQL Server directly from a web pages.   Why?   Well, for many reason. Mainly because I wanted to show a quick way to read and write the data that is inside a database. I also wanted to show that beautiful interfaces makes the web available. Finally I wanted to show you the basics of the Javascript language and also how to create an API from python . I mean, a lot of stuff, so let’s get started! Intro. Yes, this post need an introduction to descrive what we will do. In the latest post the have installed Python and with this language we have accessed data from a database in SQL Server . Today we slightly modify this project: the already written function will become an API accessible from

Python from 0 to Microsoft SQL Server! A tutorial to try step to step

Image
Hi Guys, This is not the usual post.  It is a little different post because i am in holidays with my family and because it is born from an idea of my 13 yo son Jacopo.  Since he already use Python, Javascript and other Languages while my knowledge is strongly oriented towards Microsoft SQL Server and databases, we thought about a quick tutorial on phyton . Let’s start from the installation to get to query a database in sql server with Phyton And then what’s cooler than learning the basics of a new language in minutes? If you want to take a look at his YouTube programming channel and maybe subscribe click here JacopoTech  (actually only in italian language) Enjoy the reading mates!   Python from 0. Installation Python is today a well-known language with which you can do everything. It is really worth getting to know it and trying it out for all projects from the smallest to the largest. Its installation is really simple, just download the installation files from the official site of P

What is new in the CTP 2.1 of SQL Server 2022? New T-SQL commands!

Image
Hi guys, It's time for news,  the new CTP 2.1 of SQL Server 2022 has just been released. Let's see together what are the innovations introduced. Enjoy!     SQL Server 2022 CTP 2.1   I love talking about T-SQL commands and so I'm happy to show you the new T-SQL commands just added with this latest CTP (community technical preview)  Bit Manipulation functions Bit manipulation functions are introduced perhaps to match other database engines such as mysql. They could be useful in certain areas   Now we have a LEFT_SHIFT function.   Through this function we can shift the bits of an integer to the left. There are 2 parameters. the input decimal value and the number of bit to shift.   For example: select LEFT_SHIFT (256,1) Heres the result: Rememeber that shifting one bit to the left is equal to multiply the initial value by 2 . The RIGHT_SHIFT function instead shift bits to the right.  Shifting to the right is equivalent to divide by 2.   For example: select RIGHT_SHIFT