zoukankan      html  css  js  c++  java
  • sql server 视图的操作

    -- 判断要创建的视图名是否存在
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[视图名]') and OBJECTPROPERTY(id, N'IsView') = 1)
    -- 删除视图
    drop view [dbo].[视图名]
    GO

    --例子:

    --删除视图
    drop view GetFinanceLogView
    --创建视图
    Create view GetFinanceLogView
    WITH SCHEMABINDING
    as
    select ID,OutCashAccountNo ,InCashAccountNo,Amount,RemarkContent,Type,Status,AddTime,RunWater,OperationType from dbo.FinanceLog

    --建立索引
    if (exists (select * from sys.indexes where name = 'idx_prod_ProductProgress_Sht'))
    drop index GetFinanceLogView.idx_prod_ProductProgress_Sht
    go
    create UNIQUE CLUSTERED index idx_prod_ProductProgress_Sht
    on
    GetFinanceLogView(ID);

  • 相关阅读:
    http协议
    db2 将逗号分隔数据转换为多值IN列表
    jquery deferred
    ps -ef|grep htpd|wd -l
    mysql 触发器
    css 五角星 (转)
    java 问题
    浏览器假死
    js math atan2
    CSS伪类选择器
  • 原文地址:https://www.cnblogs.com/yangjinwang/p/4205859.html
Copyright © 2011-2022 走看看