| A community of more than 1,600,000 database professionals and growing |
| | dbatools is Growing Up The dbatools.io project is growing up rapidly. I went to check something the other day and I was amazed at the command list. This used to fit on one page. Now it’s not close. Here's the first page: In fact, it doesn’t fit on two pages. Here’s the part below the fold. It’s crazy how quickly this project has grown, and how many cmdlets are available to help you not only migrate objects and settings between instances, but perform useful operations on your systems and test or change their configuration. I’m starting to think that this needs to be required for most people that manage systems. The ways that you can easily manage your systems in a programmatic manner has dramatically changed with this module. I was surprised the other day when I saw a blog post for a cmdlet I didn't know existed. I went to try it on my system and it wasn't available. I'd updated the module the previous week, but apparently there are new changes on a regular basis. I might need to update my module more often, and there's a cmdlet to help me do that! Those of us that have a lot of experience with SQL Server might find some of these tasks easier in T-SQL. I certainly spend more time inside the platform than out of it, but there are definitely advantages to using PowerShell to enforce consistency and easily work with multiple machines is nice. These utilities are often like scripts or procedures I've written to handle simple tasks in a wrapper-like fashion. dbatools do that from PoSh, and allow me to easily string together disparate comands. I won't give up T-SQL anytime soon, but I'll do more with dbatools than I might do with PoSh otherwise. If you haven't tried this project, you ought to. This will make it easier to learn PoSh and work with SQL Server. Maybe you'll enjoy it enough to built your own module and contribute to the project. There are still holes, especially in the SSIS area, though I expect new cmdlets to appear any day. Steve Jones from SQLServerCentral.comJoin the debate, and respond to today's editorial on the forums |
| The Voice of the DBA Podcast Listen to the MP3 Audio ( 2.8MB) podcast or subscribe to the feed at iTunes and Libsyn. The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. | |
|
|
| ADVERTISEMENT | | Benchmark your Database DevOps maturity level Get a better understanding of how advanced your current processes are, receive recommendations for improvements, and see how your maturity level compares with that of your peers. Complete the Database DevOps Maturity Assessment |
| | Don’t just fix SQL Server problems, prevent them from happening SQL Monitor helps teams looking after SQL Server be more proactive. Not only does SQL Monitor alert you to current issues, it gives you the information you need to stop them happening in the future. Download SQL Monitor now and get a 14 day free trial |
|
|
|
| | | This article will demonstrate how a team can use SQL Prompt to establish and share coding standards, through code analysis rules, formatting styles and code snippets. More » |
| Additional Articles from SimpleTalk SQL Server 2017 now includes a new feature to represent complex relationships in data called Graph Databases. Robert Sheldon introduces Graph Databases in the first article of this new series. More » |
| Wayne Sheffield from SQLServerCentral Blogs There are several different options available for working with tabs and spaces in SSMS. In fact, there are enough that... More » |
| Koen Verbeeck from SQLServerCentral Blogs A quick blog post for future reference, because I know I’ll bump into this again someday. When you’re working with a... More » |
|
|
| | Today's Question (by Igor Micev): You have two tables tbl1 and tbl2. You have to obtain all values that exist in tbl1 only and in tbl2 only. For this example ;WITH tbl1 AS ( SELECT a FROM ( VALUES ('a'),('b'),('c'),('d')) AS x(a) ), tbl2 AS ( SELECT a FROM ( VALUES ('f'),('a'),('b'),('c')) AS x(a) ) Which of the following queries will produce the output? a ---- d f |
Think you know the answer? Click here, and find out if you are right. We keep track of your score to give you bragging rights against your peers. This question is worth 3 points in this category: T-SQL. We'd love to give you credit for your own question and answer. To submit a QOTD, simply log in to the Contribution Center. |
|
|
| |
ADVERTISEMENT | The company's new IT initiative, code named Phoenix Project, is critical to the future of Parts Unlimited, but the project is massively over budget and very late. The CEO wants Bill to report directly to him and fix the mess in ninety days or else Bill's entire department will be outsourced. Get your copy from Amazon today. | | |
|
|
|
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Steve Jones): I want to represent this path in a string in Python: D:\SQLServerBackup\MSSQL13.SQL2016\MSSQL\Backup However, I don't want to use two backslashes for every element in the path. How can I assign this variable in Python in an easy to read manner? Answer: BackupPath = r'D:\SQLServerBackup\MSSQL13.SQL2016\MSSQL\Backup' Explanation: We can use raw strings to remove the need for any escape characters in the string. This is with an r prefx to the string. Ref: raw strings - click here » Discuss this question and answer on the forums |
|
|
| | Jayendra Viswanathan from SQLServerCentral.com SELECT INTO clause is introduced in SQL Server 2017 in which we can load table into a specific FileGroup. Lets us see an example. USE [Master] GO DROP DATABASE IF EXISTS EMPDB; CREATE DATABASE EMPDB; GO First Stage : After executing above step if you run sp_helpdb EMPDB, You will see the FILEGROUP as Primary which is the default. Data_located_on_filegroup PRIMARY USE [Master] GO ALTER DATABASE EMPDB ADD FILEGROUP [SECONDARY] GO ALTER DATABASE EMPDB ADD FILE ( NAME = N'EMPDB_FG1', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\EMPDB_FG1.ndf' , SIZE = 23456KB , FILEGROWTH = 34567KB ) TO FILEGROUP [SECONDARY] GO Second Stage : After executing above step if you run sp_helpdb EMPDB, You will see the FILEGROUP as PRIMARY which is the default and a new FILEGROP as SECONDARY will be added. filegroup PRIMARY SECONDARY USE EMPDB CREATE TABLE MyEmployee ( EName VARCHAR(50), EDept VARCHAR(15) ) ON [PRIMARY] GO INSERT INTO MyEmployee VALUES('Jim','HR') GO SELECT EName, EDept INTO Emp_PRIMARY FROM MyEmployee SELECT EName, EDept INTO Emp_SECONDARY ON [SECONDARY] FROM MyEmployee Third Stage : After executing above step if you run sp_helpdb Emp_PRIMARY, You will see the FILEGROUP for EMP_PRIMARY table as PRIMARY. Data_located_on_filegroup PRIMARY If you run sp_helpdb Emp_SECONDARY, you will see the FILEGROUP for EMP_SECONDARY table as SECONDARY. Data_located_on_filegroup SECONDARY ON keyword File Group is a very useful feature in SQL Server 2017. More » |
|
|
| Database Pros Who Need Your Help |
| Here's a few of the new posts today on the forums. To see more, visit the forums. Converting varchar to float - Hi, I get error 'Error converting data type varchar to float.' and I have a blind spot, I can't figure out... Table partitioning question - Standard steps for adding a new partition are create the file group, add the file, change partition scheme and function,... Checking sort order and fixing it - CREATE TABLE #tblTasks ( SortID Error Running SSRS Report - The server principal "DOMAIN\User" is not able to access the database "Database" under the current security context. - Hi there I have created a database, and created a procedure that joins to an additional database to retrieve Location information.... Trigger woes - Hi all We've got an application that inserts information into an SQL table (table A). The trigger on table A then either... Backing up to UNC path - I'd like to backup my databases to a UNC path. IE - \\servername\share1\. I'm a bit confused about the configuration, does the... Delete old backup files - I am wondering if someone can help me out here. We have backups in place but since we don't have... Database Restore Failing - I am hoping you can help me out here. Specifications SQL Server 2014 SP2 CU8 Windows Server 2012 3 instances on one server... How many active orders were there at the close of each day - Hello, I have an Orders table with Start DateTimes(when the order was created) and Stop DateTimes. If the Stop DateTime column IS NULL,... Insert values from one table into multiple tables - I need a little help. I have a supplied file that contains many company names and addresses. I need to... How would you parse 000.024.000 into 24H? - My table holds values like 000.004.000, 000.02.000, 000.024.000. What is the best/easiest way to get 4H, 2H, or 24H respectively? How to invoke SQL Stored procedure autmatically - Hi All, I am doing the following process manually every week, I would like to automate this as much as... Calculating memory for SQL Server on a VM machine - Dear DBAs I hope you guys are doing great I am a little confused with calculating the required RAM for... Pivot interview questions - Hi Everyone, I attended a interview in top company last week . They asked me to write a query based on following scenarios [code... TDE with trusted certs - Hello. We are switching from self signed certs to trusted 3rd party certs and we are able to do so... Anomaly/Question: SQL Server 2008 R2: Maintenace Plan Full backups no longer compressed. (Started happening on it's own without reason) - Today one of our production SQL Servers started behaving strangely. The daily full backup job which runs a "Maintenance Plan" task... HTML using XML PATH - Hi, I am generating the HTML using the XML PATH query, which is happening using the below mentioned code, the only... select query with different result - I need a query to transfer my invoicedetails to another program. I can find all the data needed, but I receive... What next???? - I have total 5 year exp In Sql, ssrs, ssis, ssas(3 year). I was thinking what to fo for next. Learning new... Error in Metadata Services. Whick Cube does it complain about? - I am getting the error shown below when deploying the project: Errors in the metadata manager. The attribute with ID of... |
|
| This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. | This newsletter was sent to you because you signed up at SQLServerCentral.com. Feel free to forward this to any colleagues that you think might be interested. If you have received this email from a colleague, you can register to receive it here. | This transmission is ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. Contact: [email protected] |
|
|