Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
Redgate University
The Voice of the DBA
 

Why I’m Learning Git via the Command Line Interface

Today we have a guest editorial from Kendra Little as Steve is away on his sabbatical.

I’ve learned a bit about Git in the last year: I’m now quite comfortable creating and managing Git Repos in Azure DevOps. I frequently do demos with SQL Change Automation and SQL Source control with Git on Redgate’s YouTube channel, and I’ve published a Git Cheat Sheet for the Command Line Interface.

I love learning Git now: I’m very comfortable with a small set of core commands which empower me to get a lot done and I’m able to regularly add new bits of knowledge into my repertoire.

I was interested in learning Git before, and I tried and failed to get started learning more than once. Each time, part of the problem was that I tried to use graphical tooling which I thought would make the whole thing simpler, but which I found to be difficult to start using – and also prone to quickly getting me into complex situations which I didn’t understand.

A big differentiator to me finally learning Git was embracing the built-in command line interface (CLI).

While command line interfaces are often harder to learn than graphical tools, in Git’s case I feel that it’s the opposite: the CLI helps you learn and focus. Here’s why:

You don’t need a lot: You mainly need to learn five or six simple, core operations which you will use 90% of the time – for everything else you’re generally going to use search engines and forum entries to figure it out case by case, anyway

It helps you learn: Mistype a command? It will list commands spelled similarly.

Simple add-ins take away the toil: Most of the pains I’ve had with Git have had to do with forgetting my current branch context, or not wanting to type out a whole command – add-ins like posh-git quickly solve these problems and let me have a simple-but-easy experience

There is a case when I’m happy to depart from the command line: when it comes to merge conflicts, I’m all about having an additional tool to help me sort out the mess. I’m a long-time fan of the editor Sublime Text, so I’ve recently been happily working with Sublime Merge (which allows you to try it out indefinitely for free).

But for everything else Git, I love learning with the CLI.

Kendra.Little

Join the debate, and respond to today's editorial on the forums

Redgate Database Devops
 
 Featured Contents

How to remove quote marks using SSIS and a little C#

glyn.jones1 from SQLServerCentral

Introduction If you import flat files and use double quotes as your Flat File Text Qualifiers, then it’s likely that you’ve encountered problems when importing data where speech marks have been entered manually. This is a common occurrence in free text fields, such as Name. e.g. Smith, James “Jim” Attempting to import a file with a […]

Introduction to Gaps and Islands Analysis

Additional Articles from SimpleTalk

T-SQL window functions simplify solving many complex queries. In this article, Edward Pollack demonstrates how the functions can be used to find gaps and islands in a dataset.

How to Complain Bitterly using SQL Data Generator

Additional Articles from Redgate

How to use reverse regex expressions in SQL Data Generator to fill a text column in SQL Server with fake, but very realistic complaints.

From the SQL Server Central Blogs - Memory Optimized Tables in SQL Server

SQLEspresso from SQLEspresso

Sometimes when I try to learn about a concept my brain blocks out everything about it. Talking about anything that uses the “In Memory” concept tends to do this...

From the SQL Server Central Blogs - DevOps for databases: “DataOps”

James Serra from James Serra's Blog

DevOps, a set of practices that combines software development (Dev) and information-technology operations (Ops), has become a very popular way to shorten the systems development life cycle and provide continuous delivery of...

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Float Issues

I have this code:
DECLARE @tmp1 FLOAT = 0.289;
SELECT
    CONVERT(INT, ROUND(@tmp1, 2) * 100.0)
What is returned by the SELECT?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Python Map

I have this code in Python:

def calcsq(n):
return n*n
numbers = (2, 3, 4, 5)
result = map( calcSq, numbers)
print(result)

What is returned when I execute this?

Answer: [4,9,16,25]

Explanation: The map() function is used to apply  a function to each item in an iterable. Both the function and the iterable are passed into map(). Ref: Python map() function - https://www.w3schools.com/python/ref_func_map.asp

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2017 - Development
Clearing the data from all the tables - Hi, there is a requirement for me to clear all the tables of the database which I am using now. There are around 100 tables in the database. Lots of unwanted data is inserted to these tables, it needs to be cleared. Most of the tables have IDENTITY (1,1) property assigned on the ID column. […]
SQL Server 2016 - Administration
SP_MSIns_ "stuck" on inserting into a table. - Hello All, I'm having trouble with transactional replication I'm hoping someone can help with. I have Server A (publisher), Distro (Distribution server), and Server B (Subscriber). All servers are 2016. B is our report server. We have a particular table I'll just call 'Sales' that might have 300 records replicated to it in a day. […]
SQL Server 2016 - Development and T-SQL
Get data on specific time interval - Hi All, Happy new year 2020. It been long time I am here. There is a job running for me daily @ 4 AM and @ 4 PM daily If any of the job failed say if @ 4 AM job failed it will be retriggered @8AM/9AM based on some business logic and if 4PM […]
Comparing to Columns from the same table - I am subtracting two columns (_REG_READING- START_REG_READING) and want to match the output (ActualRead) with another columns (FINAL_REG_QTY) to know if there is any difference. But I am getting the error message  “invalid identifier” Below is the query… select BSEG_ID,SP_ID,FINAL_REG_QTY,START_REG_READING, END_REG_READING,END_REG_READING- START_REG_READING AS ActualRead from CI_BSEG_READ where FINAL_REG_QTY <> ActualRead =---- If someone can help
How to correct the query and make it working in 2016 - WITH T1 (ID1, ID2) AS ( SELECT 1,1 UNION ALL SELECT 1,1 UNION ALL SELECT 1,1 UNION ALL SELECT 1,2 ) SELECT *, RANK() OVER (PARTITION BY ID1, ORDER BY ID2) AS 'RANK', ROW_NUMBER() OVER (PARTITION BY ID1, ORDER BY ID2) AS 'ROW_NUMBER', DENSE_RANK() OVER (PARTITION BY ID1, ORDER BY ID2) AS 'DENSE_RANK' FROM T1 […]
Two tables but if 2nd table has one row that is to be ignored - I cannot think of an easy way Two Tables Table 1    PROJECT            Project_ID , Client ID Data Project_ID , Client ID 101000   A00001 101000   A00002 102000  A1111111 Table 2   CLIENT        Client_ID    ROLE Client ID   ROLE A00001    SYS A00002   SYS A1111111   SYS SELECT * FROM […]
Administration - SQL Server 2014
Cluster, HA., replication. what are my options without a static ip address - SQL Server 2014, we have never been asked to provide redundancy until now.  We have servers but they are all virtual and do not have static ip addresses.  I need to know what kind of fail over I can do when I dont have an ip address.  I have spent most of this year researching […]
Development - SQL Server 2014
Index larger than table - I am looking at the large amount of space taken up by indexes and have a few questions; I have been searching online for a while and can't find seem to find a direct answer.  For context I have more of an Oracle background. On a table with a clustered primary key, is the row […]
SQL Server 2012 - T-SQL
How to get highest bonus and second highest bnus paid freelancer for each group - I have a table below: Freelancer(id, fl_name, bonus, fl_group) Create table Freelancer (id int, fl_name varchar(20), bonus int, fl_group varchar(50)) insert into Freelancer (id, fl_name, bonus, fl_group) Values (1, 'John', 1000, 'SQL') insert into Freelancer (id, fl_name, bonus, fl_group) Values (2, 'Jane', 990, 'MySQL') insert into Freelancer (id, fl_name, bonus, fl_group) Values (3, 'Jimmy', 320, […]
SQL Server 2019 - Administration
Track how often table rows are updated for specific columns for ETL purposes - CDC of course, but... that is overkill.   I don't want to audit the history, I want an ETL flag to know I need to reprocess those rows. I could use CDC but that has several limitations it places on the database, and the overhead is more than I need as I just need a […]
Always Encrypted - Data Types - I am starting to take an in-depth look at always encrypted and have been working through some examples. I have a column which is an integer and i have selected that column for always encrypted encryption. When i query this column, the encrypted data is returned (not an integer) but the data type of the […]
dbmail mail alert code - Hi, I am new to the SQL coding. Need help in configuring the mirroring alert when the db will go to suspect mode. I configured dbmailprofile and succesfully i am able to send the mail through sql server . now for alert i given the below step in job. exec msdb.dbo.sp_send_dbmail @profile_name='newprofile1', @recipients='abc@xyz.com', @query='select name,state_desc […]
SQL Azure - Administration
Correlation of DTU and RAM in ( GB) allocated to DB - Hi, Azure portal  and DMV providing   % of memory used by database I want to query  MAX  RAM in GB allocated to server assuming  we have only one customer  database per server DTU 500 = ? GB Ram , DTU 1750 = ? GB Ram Is this information secret ?      Thank you Alex
Analysis Services
Tabular model: compare model before and after refreshes to see changes? - Is there anyway to have SSAS compare what changed between models before and after the refresh? Once the model is refreshed it loads all the data into memory (then purges the old copy) but I was wondering if the old copy could be queried to do a diff?   Has anyone worked on anything like […]
Integration Services
Improve or replace Script Component - Dear SSC, I've been working on something here to replace a function which was called as part of a Script Task. That part actually flies now but there's more to that: Business Logic (which I moved from the Script Task to a Transformation Script Component) which seems to be processed RBAR ( which renders my […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -