在SQL Server中使用数据透视表作为视图 [英] To Use Pivot Table as View in SQL Server

查看:80
本文介绍了在SQL Server中使用数据透视表作为视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据透视表.我用SQL编写了它.但是我不能在View中使用该表.我使用的是SQL Server2008.

解决方案

请参见以下有关问题的答案:

sql-pivoted-table-is-read-only-and-cells-cant-on-edited

您需要通过INSTEAD OF触发器使视图可更新,并且使用该触发器有一些特定条件,例如,数据透视表视图可以完全识别为源记录列.

I have got a pivot table. I prepared it in SQL. But I cant use this table in View. I using SQL Server 2008.

解决方案

See this answer to a somewhat related question:

sql-pivoted-table-is-read-only-and-cells-cant-be-edited

You need to make the view updateable via an INSTEAD OF trigger, and there are specific conditions to using that trigger, such as the pivot-table view being fully identifiable to source record-column.

这篇关于在SQL Server中使用数据透视表作为视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆