SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

The Voice of the DBA

An Open Thank You to the Microsoft SQL Server Team

Thank you, Microsoft SQL Server Development team. I really am happy with your work.

I was going through emails and noticed the someone had posted a surprise in the SQL Server 2019 CTP. The post was slightly cryptic, but since I saw the dreaded string-or-binary-data-truncated message, I was intrigued. Digging further, with some help from fellow MVPs, I found that one of the most voted on feature requests was actually implemented. I blogged about this briefly, but in case you wonder, this is the message in SQL Server 2017 and below:

Msg 8152, Level 16, State 14, Line 8
String or binary data would be truncated.

In SQL Server 2019, I get this from the same repro:

Msg 2628, Level 16, State 1, Line 8
String or binary data would be truncated in table 'Sandbox.dbo.Customer', column 'CustomerName'. Truncated value: 'Is this th'.

You do need to enable trace flag 460, but this works and should help you find that problematic data. I'm really glad that Microsoft has implemented the first stages of a fix, and I do appreciate their efforts here. This is a nice step forward.

I do hope that future versions, or even continued development on SQL Server 2019 will enhance this. Right now I just get the first occurrence, which is good, but I'd love it if we could get a result set back, or maybe an indication of more problems. I know I'm asking for more here, but there is room for improvement.

If this is all we get for SQL Server 2019, that's fine. I think this is going to be very helpful for those problematic imports, and at least help us find bad data more quickly in those poorly structured input strings.

Steve Jones from SQLServerCentral.com

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


The Voice of the DBA Podcast

Listen to the MP3 Audio ( 3.1MB) podcast or subscribe to the feed at iTunes and Libsyn. feed

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
Database DevOps

Database DevOps Demo Webinar

Learn how to automate your database deployments alongside your app code in this free demo webinar. Register now

SITC

SQL in the City Summits - New York, London & Chicago

This October, Redgate are inviting those interested in learning how their business can benefit from implementing Compliant Database DevOps to attend one of our SQL in the City Summits. If you manage SQL Server databases, or manage a team of people who do so,  Redgate’s SQL in the City Summit is the conference for you. Find out who’s presenting and register for a Summit near you today.
Register now

Featured Contents

 

Security, Compliance, Data Ethics, and Breaking the “Not My Job” Mindset

Additional Articles from SimpleTalk

Security, compliance, and data ethics are related concepts that everyone who works with software should know about, from the help desk to the C-level office… but almost everyone thinks that worrying about these things is someone else’s problem. More »


 

SQL Server From .Net: Using SQL Server Schema to Build a Data Set

Tim Wellman from SQLServerCentral.com

A basic introduction for developers (or anyone) to using the metadata for a SQL Server database to build a DataSet in ADO.Net that represent objects in any SQL Server database. More »


 

Redgate's Estate Management Research Survey

Redgate invites you to take their Estate Management Research Survey. Their aim for this questionnaire is to gather some information around the importance of certain tasks within the wider umbrella of ‘Estate Management’ and your satisfaction with your current solutions to them. The survey should take around 10 minutes to complete. Help them continue to support and build relevant tools to help you in your job and in recognition of you taking time to help us, they will award an Amazon voucher or equivalent to the value of $50 to one lucky survey participant. This will be determined in early October 2018. More »


 

From the SQLServerCentral Blogs - Do You Need a Relational Data Warehouse?

DataOnWheels from SQLServerCentral Blogs

Are you looking to do a major update to your data warehouse or looking to modernize? Many technologies have come... More »


 

From the SQLServerCentral Blogs - You can’t DELETE TOP (x) with an ORDER BY

Kenneth Fisher from SQLServerCentral Blogs

Did you know you can’t do this? DELETE TOP (10) FROM SalesOrderDetail ORDER BY SalesOrderID DESC;Msg 156, Level 15, State 1, Line 8 Incorrect... More »

Question of the Day

Today's Question (by Eirikur Eiriksson):

Overloading of functions is something that is not native in the T-SQL syntax convensions, it does though happen behind the scene, so be aware!

A fact: we know is that normally, the replicate function only returns up to 8000 characters or 4000 characters for the double byte character types. How can we make the function return longer string values?

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 1 point in this category: functions.

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

Microsoft SQL Server 2017 on Linux

This comprehensive guide shows, step-by-step, how to set up, configure, and administer SQL Server 2017 on Linux for high performance and high availability. Written by a SQL Server expert and respected author, Microsoft SQL Server 2017 on Linux teaches valuable Linux skills to Windows-based SQL Server professionals. You will get clear coverage of both Linux and SQL Server and complete explanations of the latest features, tools, and techniques. Get your copy from Amazon today.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I have a dataframe, pass.videos, of the PASS videos from 2016. I can't remember what the structure of the dataframe is, but I want to just get the first 4 rows to see the column names and data. How can I do this in R in order to return this data?

 Index SessionSID Session Speaker 1 1 65091 DevOps Tool Combinations for Winning Agility Kellyn Pot'Vin-Gorman 2 2 65092 Oracle vs. SQL Server - The War of the Indices Kellyn Pot'Vin-Gorman 3 3 65112 Make Power BI Your Own with the Power BI APIs Steve Wake 4 4 65117 A Deep Dive into Data Lakes Ust Oldfield 

Answer: head(pass.videos, 4)

Explanation:

The HEAD() function will return the first x videos, where x is the second parameter passed in. For this example, head(pass.videos,4) is used.

Ref: head() - 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 2017 : SQL Server 2017 - Development

Update Trigger to modify two tables - Hi folks, I'm trying to update 2 tables (one audit table and the main table with the most recent username) with...

Referential Integrity vs. Performance - I haven't posted in this forum for a while so please forgive me if my post question isn't in the...


SQL Server 2016 : SQL Server 2016 - Administration

Encrypt Connection - how do I know what certificate is being used for the current connection - *When I connect using Trust Server Certificate - how can I see what certificate is being used? Using SSMS I can connect...

Backup - I need to take a  adhoc full backup on a prod server. Can I take the backup with out copyonly...

BCP command in Linux through Putty - Hi Excerpts, I would require your help on below issue.I am new in MSSQL. My file is present in Linux server and...

e-commerce company, planning to start a sale offer in december - Hi Experts, We are a small e-commerce company, planning to start an offer in december. The offer would be online on...

Question: Recover database with minimal data loss example question - Recover database with minimal data loss question Hope someone can help a bit.  I've been going through some practice questions online for...


SQL Server 2016 : SQL Server 2016 - Development and T-SQL

Update 200 tables in database - I have two databases with a couple hundred tables in them each.  The tables in the two databases are 90%...

BCP command executing in Putty - Hi Excerpts, I would require your help on below issue.I am new in MSSQL. My file is present in Linux server and...

How to use HASHBYTES function in sql server for multiple columns - I have a requirement wherein I have to create hashvalue which consist of all columns of a table. With Checksum...

SQL Server stored procedures fast in SQL but slow when called by ASP.NET - Query inside the stored procedure giving result fast (twenty seven  thousand records in 2 seconds) but when i called the...

Insert 2k rows in one second - Hi ,  I have a bourse application that in beginning of the day , service application get 2K messages that this messages...


SQL Server 2014 : Administration - SQL Server 2014

What database is this referring to? -- Table error: IAM page - Hello, Is it possible to find out what database or maybe even table the log below is pointing to? I thought...


SQL Server 2014 : Development - SQL Server 2014

Identifying field value corresponding to MAX of another field value - Hey All, I'm hoping to get your expertise on this. I'm trying to populate a temp table as part of a...

'Error: Invalid Custom SQL query. Permission was denied' - Hi,  The sproc uses linked server to connect to a database. And it executes well on SSMS. However, on the front...

Pulling Top XX rows, where XX is a percentage of records - it never stops around here. . . lol My clients brings in between 20,000 and 30,000 SKUs a month. He wants me to audit...

Select Number of Times a Product sold per minute - Hello Everyone, I am in need of some assistance with an odd type of query.  From the data listed below, I...


SQL Server 2012 : SQL 2012 - General

Cannot drop the user 'dbo' - I used to know how to do this, but nothing I try is working. My personal login is associated with a...


SQL Server 2012 : SQL Server 2012 - T-SQL

Regex in Replace? - Hello. I'm trying to turn something like '{1,2,3,4,5}' into '1,2,3,4,5'. I can't be certain that the curly braces will always...


Data Warehousing : Integration Services

Passing table_name as a variable into an oledb source - Hi, I am using BIDS on SQL Server 2008 R2  and I have a sql script that loops through tables returned...

This email has been sent to newsletter@newslettercollector.com. 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.
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: webmaster@sqlservercentral.com