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

Daily Coping Tip

Focus on the basics, eat well, exercise, get rest.

I also have a thread at SQLServerCentral dealing with coping mechanisms and resources. Feel free to participate.

For many of you out there working in a new way, I'm including a thought of the day on how to cope in this challenging time from The Action for Happiness Coping Calendar. My items will be on my blog, feel free to share yours.

Unix vs PowerShell

I saw an article on using awk, sed, and grep on Linux. I used to know how to use those, though I was by no means an expert. However, working with a stream of text with an input and output was a valuable skill I've used over and over in my career. There are plenty of times when I've needed to handle a long set of text, and my practice with Unix in university helped me a lot. I've only lightly needed to use Perl and regex in my career, but I was glad I had some idea of what I was doing.

In the last few years, I've spent quite a bit of time working with PowerShell (PoSh) instead of text-based utilities. While I found some of the design cumbersome and unintuitive, overall, the idea of working with objects instead of a stream of text is really nice.

PowerShell was devised to get around some of the complexities of these utilities. It was built to be an integrated shell, with lots of improvements on the way one might use the utilities above in a bash or Korn shell. While it can take a bit of getting used to, in many ways, I do think it's superior to the old paradigm of chaining together lots of utilities.

What's more, it's fairly easy to enhance PoSh with your own routines, and many vendors have taken advantage of this to provide APIs and interfaces with their tools. Plenty of corporate Ops and IT departments have done the same thing, publishing routines that anyone in their organization can expect to exist and use.

I loved Unix, way more than DOS in most ways when I was in university. If I'd been a decade younger, I might have even evolved into Linux and pursued a career in that environment. These days, with plenty of MS software, including SQL Server, moving to Linux, I'm happy to change to that platform. However, with PoSh being available cross platform, I think I'd be looking to use PowerShell as my shell and scripting platform of choice, even on Linux.

Steve Jones - SSC Editor

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

 
 Featured Contents

Be aware of the risk that you are taking when using AWS EC2 I3 instance type

Steve Rezhener from SQLServerCentral

The AWS I3 storage optimized instance family has a potential problem if you choose to use it for storing your data.

Our Top Findings from The State of Database Monitoring Survey

Additional Articles from SQLServerCentral

Over 2500 global database professionals answered questions on their experiences with database monitoring in our annual survey earlier this year. We’re creating four reports from the findings and in our first, The real-world challenges of growing server estates, you’ll discover both insights and trends along with advice for how to tackle the most common challenges.

SQL Server identity column

Additional Articles from SimpleTalk

The SQL Server identity column is used to populate a column with incrementing numbers on insert. In this article, Greg Larsen explains how it works.

From the SQL Server Central Blogs - Divide the rows of a column in equals batches in grid format

Brahmanand Shukla from SQL Server Carpenter

I published an article Divide the rows in equals batches few days ago. One of my reader requested me to help him with a requirement to divide a column’s...

From the SQL Server Central Blogs - Single-cloud versus Multi-cloud

James Serra from James Serra's Blog

A discussion I have seen many companies have is if they should be single-cloud (using only one cloud company) or multi-cloud (using more than one cloud company). The three...

 

 Question of the Day

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

 

Default Time

How long does this statement pause execution?
WAITFOR DELAY '0:1'

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)

Row and Page Compression Facts

Which two of these are not true about Row and Page Data Compression in SQL Server 2019?

Answer: System tables can be compressed., Compression allows more rows to be fit on a page

Explanation: Of these items, system tables cannot be compressed, so this one is false. Compression does not allow more rows on a page, which is false. Compression does not change the max row size, and off row data is not compressed. Ref: Data Compression - https://docs.microsoft.com/en-us/sql/relational-databases/data-compression/data-compression?view=sql-server-ver15

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 - Administration
Locking and Blocking - Had update query running and select query also running at the same time , but getting time out expired for select query after waiting 30 sec to lock. Update query having no lock and resource consumption 17% IO and CPU. query plan having cluster index seek. Please help out to avoid time out expiry for […]
CU25 cant install because of SSRS - I have a strange issue at a customer of mine that I have never seen before: on a SQL2017 there is a Reporting Services installed as well and it seems this one is blocking the patching of the DB service The version number 14.0.600.1669 is actually a version number coming from the Reporting Services that […]
SQL Server 2016 - Administration
Setting permissions for user to query DMVs without admin rights - What is a rightest way to grant such permissions to a non-admin user? User belongs to a group that has certain limited permissions on the server, with access to only several user databases. The user however needs to query DMVs in Master DB. Is it doable? and what is a good way to do it? […]
the owner of BAK files - Hi All, How do I find out the owner of bak files ? There are some old bak files in D:\ that I want to clean up but thinking it is best to get the permission first thank you    
SQL Server 2016 - Development and T-SQL
Exclude rows where value used in another row - I need to exclude data from a select query where the value of column A is used in other rows and the values of column B are different. Column A | ColumnB PhoneNumber | FirstName ------------|---------- 02038245161 | Jon 02038245161 | Henry 02038881121 | Jamie 02038881121 | Jamie From the above table I want to […]
Is it possible to display XML data in SSRS report tablix neatly and fully? - How can I display XML data in SSRS report from a XML col in table just like it displays in SSMS? Is it possible to see it in SSRS report same way as on the screenshot? Right now it displays only as on the second screenshot, with wrapping, and not clickable. One row takes pages... […]
hierarchy related query - Hello friends. I have a hierarchy table like this: Month empEntityID empID empName mgrID empEntityID1 empID1 empName1 empEntityID2 empID2 empName2 empEntityID3 empID3 empName3 empEntityID4 empID4 empName4 empEntityID5 empID5 empName5 empEntityID6 empID6 empName6 Month contains first calendar date of a month which shows which month a hierarchy set belongs to. Every employee is mentioned in first […]
Development - SQL Server 2014
Perpetual Total - calculate difference between first and last value - Hi, I'm having to calculate a daily total tons from a continually incrementing number  for a few products. I capture these increasing totals every 15 mins , I'm look at the best way to use a select query to achieve this, and  thinking I need to use the first entry for the day at Datetime […]
SQL Server 2012 - T-SQL
get lastname,firstname, middlename as first 3 pipe delimiter last data no need - NAZARE|DEV|T||Current~NAZARE|DEV|T||Previous The above data NAZARE =Lastname , Dev=Firstname T= lastname . Could you please help me to writ in select statement using substring and charindex Pipe delimiter
SQL Server 2019 - Administration
Cross domain authentication - 'The target principal name is incorrect..' - I have problem with windows authentication. I have two domains (Lets say A and B), and server which is at the domain A. It is an default instance on the server and it uses AD account as an service account. What is a little bit odd is that there is a small difference between DNS of that VM and […]
Entire Row to be Unique in the whole Table... - Hi Friends, I am having a need to implement a Business requirement where in each row in the whole table must be unique.Would be grateful if I can get any help from you in achieving this...Thank you in advance! Best Regards, Arshad  
SQL Server 2019 - Development
Assign multiple fields to one variable - Hi I need to write a query / procedure that will create the following string - Column1Name=Column1Value;Column2Name=Column2Value...etc I have no clue on how to do that with sql. In c# or vb.net is quite simple and straight forward. It seems to me that in sql I have to know the columns names in advance, so […]
FullText Search on PDF files - Hi We have an existing solution where we store documents in the database in FileStream tables. The users are allowed to search for content in these documents, using FullText and IFilters in combination we can do CONTAINS searches on document content. This has worked for years, and still do. Adobe has removed their download links for […]
sp_send_dbmail: Failed to initialize sqlcmd library with error number -214746725 - This one is bugging the daylights out of me. We've got a stored proc that does some error checking then sends an email if there is an error. I can get it to work as long as I don't use the @query switch for sp_send_dbmail. As soon as I uncomment that, the code fails. I've […]
Reporting Services
High Report Export Volume - Hi There, I have a requirement to develop a solution to generate approximately 6,500 reports within a 2 hour processing window, and then export the reports in either PDF or Excel format to a secure ftp site.  The source is SQL and the report data is from stored procedures.  Currently this is being handled with […]
 

 

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

 

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