 | A community of more than 1,600,000 database professionals and growing |
| | The March of AI Machine learning and AI systems are becoming more and more popular all the time. The constant onslaught of media articles and hype is pressuring more and more companies to experiment with AI systems. Whether these techniques work or not, no manager wants to be the one that has ignored the trend. A failed machine learning venture might be preferable to the lack of any project in the eyes of many in upper management. Our vendors press as well, after all, sales are on the line. I wasn't sure how useful the R language would be inside SQL Server, but I am amazed at the effort and popularity of R among SQL Server professionals. R, and possibly Python soon, are becoming integrated into every product and tool from Microsoft, as well as other vendors. Every month I see more and more people experimenting and learning how to use R for a wider variety of tasks, from analyzing disk space and database performance to extrapolating business measures. Most of us aren't skilled enough in math and statistics to really develop and build intelligent systems. We don't have the background, or we haven't worked in those areas for a long time. However, many of us can learn to work with ML and AI systems, managing the models, integrating the code others write into our applications. I do think there is value in learning a bit about these technologies, though I don't think you need to become an expert. Some of you might want to be experts, and I wish you the best of luck on your journey. I do believe that AI will change the world. It's going to become a larger and larger part of many systems and processes throughout the world. These intelligent systems will press and push humans in ways that we don't expect and that we might not like. For us data professionals, we will be at the heart of many of these changes, with opportunities to grow our careers we might never had considered. 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 ( 3.0MB) 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 |  | Free whitepaper: Solving the database deployment problem with Database DevOps Don’t let the database be a blocker to DevOps success. Learn how Database DevOps helps your team deliver value quicker while keeping your data safe. Download the free whitepaper |
|  | SQL Clone: Now supporting databases up to 64TB Create copies of production databases and SQL backups in seconds and save up to 99% of disk space using SQL Clone. Redgate’s new tool removes much of the time and resource needed to create and manage database copies, allowing teams to work on local environments to develop, test and diagnose issues faster. Try it free |
|
|
|
| |  | Michael Williams from SQLServerCentral.com The Execute Package Task is an essential tool for any SSIS developer. Learn how to get the most from it. More » |
 | Additional Articles from Database Journal There are multiple ways to accomplish a database restore. But if you wanted to restore a database from a script how might you accomplish that task quickly and accurately? More » |
 | Grant Fritchey from Redgate "There have been, and, in our increasingly connected and interconnected world, will continue to be, a large number of spectacular failures with technology. I want to point the finger at all of us for these failures. It’s not Development. It’s not Operations. It’s us. We’re in it together. If we don’t communicate with each other, share our knowledge, we’re going to mess up horribly." More » |
 | kleegeek from SQLServerCentral Blogs VM snapshots are one of the best virtualization features ever. But…have you ever had a VMware vSphere or Hyper-V snapshot... More » |
 | Grant Fritchey from SQLServerCentral Blogs SQL Server provides multiple ways to perform most functions. In order to maximize your understanding of how SQL Server works... More » |
|
|
| | Today's Question (by Stewart Campbell): You are tasked with identifying the maximum length of data contained in some of the larger tables in your database. To achieve this, you write the following script: DECLARE @TableName SYSNAME = 'TheTable', @Col SYSNAME, @SQL NVARCHAR(1000) = '', @Max INT; DROP TABLE IF EXISTS #Cols; CREATE TABLE #Cols (ColumnName SYSNAME, MaxLen INT); INSERT #Cols (ColumnName) SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_Name = @TableName AND DATA_TYPE LIKE '%varchar'; DECLARE MaxCol CURSOR LOCAL FAST_FORWARD FOR SELECT ColumnName FROM #Cols; OPEN MaxCol; FETCH NEXT FROM MaxCol INTO @Col; WHILE @@FETCH_STATUS = 0 BEGIN SELECT @SQL = N'SELECT @Max = MAX(DATALENGTH(' + QUOTENAME(@Col) + ')) FROM ' + QUOTENAME(@TableName); EXEC sp_executesql @SQL, N'@Max INT OUTPUT', @Max OUTPUT; UPDATE #Cols SET MaxLen = @Max WHERE ColumnName = @Col; FETCH NEXT FROM MaxCol INTO @Col; END CLOSE MaxCol; DEALLOCATE MaxCol; SELECT * FROM #Cols; What, in your opinion, will be the result of the script execution? Assumptions: - Running SQL Server 2016 or greater
- TheTable exists, has nvarchar and/or varchar columns, and is populated with copious amounts of data.
|
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 2 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 | Pro Power BI Desktop This book shows how to deliver eye-catching Business Intelligence with Microsoft Power BI Desktop. You can now take data from virtually any source and use it to produce stunning dashboards and compelling reports that will seize your audience’s attention. Slice and dice the data with remarkable ease then add metrics and KPIs to project the insights that create your competitive advantage. |  | |
|
|
|
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Steve Jones): I write this in R: Exclamation <- c('SQL', 'Server', 'is', 'great!') If I then run this, what is returned? Exclamation[1] Answer: SQL Explanation: A vector, similar to an array, in R is 1 based. Therefore the first element has 1, not 0, as an index. Ref: Indexing - click here
» 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 suddenly crashes - Hello Everyone, I have a Windows Server 2016 server which is running SQL Server 2016. My application interacts with the server and... SQL 2016 SP1 CU2 - sudden and unexplained shutdowns - Hi there, Anyone had problems with unplanned instance shut-downs on SQL 2016 SP1 CU2? We patched our Data Warehouse to CU2 in... Cursor Performance - OK so we have an application that has gone through an upgrade which also saw the database move from a... Stored Procedures for document Numbers - CNCB 17 1 CNPO 17 1 CNCP 17 3 PRT 17 5 POD 17 7 SCT 17 8 EMAIL 17& SQL Streaks - Hi I wish to calculate several flags for the streaks in SQL I have added the tables and the desired table I... Procedure plan changed suddenly - Hello, Is there anyway to find how suddenly a procedure plan is changed. I understand that there can be multiple reasons... Splitting TempDB - Hi, I noticed yesterday that I have the following setup for one of my production virtual database servers: 1 socket, 8... Transaction replication is looks not working. - Hi, I Just joined to company and give me to bunch of SQL Servers to do admin. I noticed there is... General advice needed - database design - Is this a bad way to design a pricing table? - Suppose we are selling bottles of water that can be bought in sizes of 1 to 10 litres (1, 2,... Multiple Values for Single Parameter in User Defined Function - Did anyone come across this scenario where a developer/analyst comes in and pass multiple values for Parameter so he/she can... How to make relation between tables to calculate cost of flight and transfer and hotel and excursion per every day ? - I need to design database for Tourism Company organize more tours based on the following tables Hotels HotelID Hotel Name 11 & How to calculate cost of flight and hotel and transfer per every program ? - How to design database for tourism company to calculate cost of flight and hotel per every program tour based on... How to calculate cost per every day(cost hotel + cost flight) depending on flight date ? - I need to make database design relations to calculate cost per tour for tourists in Egypt Flight cost + hotel cost... Please help on reformatting this table into another format using TSQL - Hi guys, I will really need you guys help on reformatting a table into another format for export in CSV file. I... Using comma delimited value for a lookup into table - I had found SQL code previously that would let me use a comma delimited value in one table to return... CPU troubleshooting with Perfom counters - I have put 2 PERFMON counters to troubleshoot high CPU utilization due to SQL server 2008 on a windows host... Communication link failure error while running a SQL agent job in SSIS. - We are getting communication link failure error for a direct loading package in SSIS frequently with errors like 1) Shared... SQL behaving strangely on different servers - Hi All, I have a sql statement working on static tables (no Insert,Update,Delete) on our testing server it's running very fast... How to convert Large text file to Excel - Can we convert large Text file to Execl file ? Then we need to split into multiple excel having max size... How to find Week start date and Week end date - Hi All, I have one senario. if i give like 3/5/09, then need to get 3/2 through 3/5. if i give like 3/2/09 then... |
|
| 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 ©2017 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. Contact: [email protected] |
|
|