Msg 4701, Level 16 trying to truncate table through Linked Server

I was trying to truncate a table on a remote server using a Linked Server and received the following error:

Msg 4701, Level 16, State 1, Line 6
Cannot find the object "bill" because it does not exist or you do not have permissions.

Read on to see how I solved this issue.

Continue reading Msg 4701, Level 16 trying to truncate table through Linked Server

Msg 7399, Level 16, State 1 Linked Server. Access Denied

I setup a linked server on a new database server and was trying to run a query that runs against an Oracle database and I got the following error:

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider “OraOLEDB.Oracle” for linked server “ccbtst” reported an error. Access denied.
Msg 7350, Level 16, State 2, Line 1
Cannot get the column information from OLE DB provider “OraOLEDB.Oracle” for linked server “ccbtst”.

Continue reading Msg 7399, Level 16, State 1 Linked Server. Access Denied

Msg 8115, Level 16 Arithmetic overflow

In Sql Server, if you try to count more than 2.1 billion rows or sum up values more than that, you will get this message: Msg 8115, Level 16, State 2, Line 1 Arithmetic overflow error converting expression to data type int.

Today I will show you the solution to this problem.

Continue reading Msg 8115, Level 16 Arithmetic overflow

SQL Server 2019 New Feature — Msg 8152, Level 16, State 14 String or binary data would be truncated. Improvement!

There are all kinds of new features in the new version of SQL Server 2019.  One of the ones I am excited about is the additional information you now receive be default when you try to insert data that is too long to fit into an existing field.  In prior versions you would get the message below, but you would have no idea what row or field was causing the issue:

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

Continue reading SQL Server 2019 New Feature — Msg 8152, Level 16, State 14 String or binary data would be truncated. Improvement!

Insert into Table with an Identity column

Have you ever deleted a row of data and then needed to put it back due to being told it was the wrong row, but the table had an identity column and will not let you insert the row back?  Using the Set Identity_Insert command, you can insert into the table.

Continue reading Insert into Table with an Identity column