Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the SQLServer error message 7347, level 16

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to solve SQLServer error message 7347, level 16". In daily operation, I believe many people have doubts about how to solve the problem of SQLServer error message 7347 and level 16. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer "how to solve SQLServer error message 7347, level 16". Next, please follow the editor to study!

SQLServer queries the view through the linked server and reports an error "message 7347, level 16"

Problem: remotely view a table through a linked server. The error is as follows:

Message 7347, level 16, status 1, line 1

The data returned by the OLE DB provider 'SQLNCLI11'' of the linked server '192.168.200.51' does not match the data length required for column'[192.168.200.51]. [ERP]. [DBO]. [VP _ cust] .PName'. The required (maximum) data length is 30, but the returned data length is 37.

The cause of the problem:

The structure of the base table where the view is located has changed, and the character length of the PName field has become longer, but the table viewed remotely through the linked server still uses the original character length of the table PName field, the information of the table structure change is not synchronized, and the data length displayed during query is not enough.

Solution:

Manually refresh the view

EXECUTE sp_refreshview Neighdbo.vpact cust`

The problem recurrence process is as follows:

192.168.100.100 server creates a linked server to connect to the TESTDB database of 192.168.100.200

-192.168.100.200

Create test data

Use TESTDB

Create table test1013 (id int,col1 varchar (3))

Create view v_test1013 as select * from test1013

Insert into test1013 values (1)

Insert into test1013 values (2)

Insert into test1013 values (3 ~ ccc')

-192.168.100.100

Select * from [192.168.100.200]. [TESTDB]. [DBO]. [v _ test1013]

Id col1

1 a

2 bb

3 ccc

-192.168.100.200

Alter table test1013 alter column col1 varchar (5)

Insert into test1013 values (5)

Select * from v_test1013

-192.168.100.100

Select * from [192.168.100.200]. [TESTDB]. [DBO]. [v _ test1013]

Message 7347, level 16, status 1, line 3

The data returned by the OLE DB provider 'SQLNCLI11' of the linked server' 192.168.2.141 'does not match the data length required for column' [192.168.2.141]. [erp352]. [dbo]. [v _ test1013] .col1'. The required (maximum) data length is 3, but the returned data length is 5.

-192.168.100.200

EXECUTE sp_refreshview Naturdbo.vroomtest1013'

-192.168.100.100

Select * from [192.168.100.200]. [TESTDB]. [DBO]. [v _ test1013]

Id col1

1 a

2 b

3 ccc

5 eeeee

At this point, the study on "how to solve the SQLServer error message 7347, level 16" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report