SQLSELECT statements are used to retrieve data from the database and also, they populate the result of the query into the result-sets. The SQL examples of this article discourse and explain the fundamental usage of the SELECT statement in the queries.
Languages and coding
Creating and Removing Databases with PowerShell In Azure Cosmos DB
May 27, 2019Our testing or development may call for dynamic creation on the database level for Azure Cosmos DB rather than the account level. As we’ve seen with dynamically working with a Cosmos database account using PowerShell, we can create, remove, and obtain properties of the account. Identically, we can do this on the database level as well and we may use this in testing if we need the same Cosmos database account for other testing purposes. Development situations may also involve use cases where we want to test a concept and dynamically create a database within our Cosmos database account. In this tip, we’ll look at working with our Azure Cosmos database account on the database object level where we do nothing to manipulate the account itself, only add databases to the account once it’s been setup.
Read more »Getting and Updating Connection Information for Azure Cosmos DB
May 24, 2019After we set up our Azure Cosmos DB, we may want to get, add to, or update existing properties. We may use some of the get functionality that PowerShell provides to dynamically save values to encrypted configuration files or tables that we use for application purposes and this functionality could be added to the creation of the Cosmos database account, or a separate step in addition to the creation. In secure contexts, this ensures security without the properties after passing through human eyes since they are saved directly to an encrypted location. In the same manner, we may want to regenerate the keys for the account and save the connection strings with the new keys.
Read more »Creating a SQL Server Database using DBATools
May 23, 2019DBATools is an open source PowerShell module with useful commands to do the administrative task in SQL Server. In my earlier articles on DBATools (see TOC at the bottom) we explored installation and performing database backups, restoration, and validation with DBATools.
Read more »Creating and Removing Azure Cosmos DBs with PowerShell
May 21, 2019When managing Azure Cosmos DB, we can use the Azure portal and create resources through the interface or use the command line in the portal and create resources. PowerShell also supports some functionality for creating and managing these resources, which can help development teams automate the creation of these databases for quick creations, unit and security tests, removals if the resources aren’t required following the tests. We can also use these scripts for creating templates that we may use in multi-scaling creations (like databases in a group designed for horizontal scale). Generally, in one-off situations, the Azure Portal will suffice for deployments if there is a cost to develop automation that is not required. In this tip, we’ll look at the process of creating a blank and removing the same Azure Cosmos DB.
Read more »SQL IF Statement introduction and overview
May 20, 2019This article explores the useful function SQL IF statement in SQL Server.
Extract Azure Costs Using PowerShell
May 20, 2019With strong organization and design for our development teams, cloud infrastructure and security considerations, we’ll now extract Azure cost information that we can share with our organization. In addition, we will see that we can retain this information if needed to track growth (or reduction) in costs. This step is important as it will allow our teams to have an insight into their development and it will also be another audit we can use on the security side to catch unusual growth (or significant reductions) in resource costs that may be the result of an attacker. Our ultimate goal with tracking these costs and sharing them with teams is to improve our development and possibly re-organize it as needed, giving us the ability to further reduce our spending.
Read more »SQL Server CONCATENATE Operations with SQL Plus (+) and SQL CONCAT functions
May 13, 2019This article explores SQL Server Concatenate operations using the SQL Plus (+) operator and SQL CONCAT function.
Read more »SQL Server Always ON Availability Group Log Backup on Secondary Replicas
May 10, 2019In a high OLTP environment, we may observe strain on CPU and IO due to frequent backups. It might include further complexity due to backup compressions. SQL Server Always On Availability groups provides the capability to perform database backups from the secondary replicas. This article explores Log backups in SQL Server Always On Availability Group.
SQL ISNULL function
May 10, 2019This article explores the SQL ISNULL function to replace NULL values in expressions or table records with examples.
SQL CHARINDEX
May 9, 2019We use the SQL CHARINDEX function to find the position of a substring or expression in a given string. We might have a character in different positions of a string. SQL CHARINDEX returns the first position and ignores the rest of matching character positions in a string.
Read more »Data Sampling with Python SQL Scripts
May 9, 2019Introduction
The Python programming language is object oriented, easy to use and, widely used programming language. We can write simple Python SQL Scripts and it performs the task that is not easy to do with t-SQL.
SQL Server cursor attributes
May 8, 2019A SQL Server cursor is a database object that is used to process the data in a set row by row. In this article, we will review how to create a cursor and different attributes used while declaring a cursor.
Read more »DATEADD SQL function introduction and overview
May 6, 2019This article explores the DATEADD SQL function and its usage scenarios with various examples.
Fix Orphan users in SQL Server using DBATools PowerShell
April 30, 2019This article gives an overview of Orphan users and fixing them using DBATools PowerShell.
Read more »SQL TRIM function
April 24, 2019In this article, we will review the new SQL TRIM function in SQL Server 2017 onwards as well as providing some information on strings functions that pre-date it like LTRIM AND RTRIM.
Read more »DATEPART SQL function
April 23, 2019This article explores the DATEPART SQL function and its use in writing t-SQL queries. In the previous article, SQL Convert Date Functions and Formats, we explored various data formats and convert them using SQL Convert function.
SQL Add Column operations
April 22, 2019This article explains the SQL add column operation into an existing SQL table. We will also explore different examples of SQL add column operations.
Read more »PowerShell encrypt password techniques for SQL Server
April 18, 2019Challenge
Automating SQL Server tasks with PowerShell can increase productivity and save time, but how do use PowerShell encrypt password techniques to avoid saving them as plain text. This article will show you how.
Read more »SQL Union vs Union All in SQL Server
April 18, 2019This article explains to the SQL Union and vs Union All operators in SQL Server. We will also explore the difference between these two operators along with various use cases.
Read more »SQL OUTER JOIN overview and examples
April 16, 2019This article will provide a full overview, with examples of the SQL Outer join, including the full, right and left outer join as well as cover the union between SQL left and right outer joins.
Read more »INSERT INTO SELECT statement overview and examples
April 12, 2019This article covers the SQL INSERT INTO SELECT statement along with its syntax, examples, and use cases.
Read more »Methods to Insert Data into SQL Server
April 10, 2019Summary
There are a variety of ways of managing data to insert into SQL Server. How we generate and insert data into tables can have a profound impact on performance and maintainability! This topic is often overlooked as a beginner’s consideration, but mistakes in how we grow objects can create massive headaches for future developers and administrators.
Read more »SQL PARTITION BY Clause overview
April 9, 2019This article will cover the SQL PARTITION BY clause and, in particular, the difference with GROUP BY in a select statement. We will also explore various use cases of SQL PARTITION BY.
Read more »SQL Order by Clause overview and examples
April 9, 2019This article will cover the SQL ORDER BY clause including syntax, usage scenarios to sort out results in a Select statement.
Read more »