sql2005 64 位 连接 sql2000 32位

首先确定sql2000必须达到sp3补丁以上,再执行下列语句,可处理定时任务无法执行问题。

USE [master]

GO

/****** 对象:  StoredProcedure [dbo].[sp_tables_info_rowset_64]    脚本日期: 12/10/2013 16:23:34 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

/*  Procedure for 8.0 server */  

create procedure [dbo].[sp_tables_info_rowset_64]  

    (  

    @table_name sysname,   

    @table_schema   sysname = null,   

    @table_type nvarchar(255) = null   

    )  

as  

    select  *  

    from    (select TABLE_CATALOG       = db_name(),  

            TABLE_SCHEMA        = user_name(o.uid),  

            TABLE_NAME      = o.name,  

            TABLE_TYPE      = convert(nvarchar(30),  

                            case o.type   

                            when 'U' then   

                                case when ObjectProperty(o.id, 'IsMSShipped') = 0  

                                then N'TABLE' else N'SYSTEM TABLE' end  

                            when 'S' then N'SYSTEM TABLE'  

                            when 'V' then   

                                case when ObjectProperty(o.id, 'IsMSShipped') = 0  

                                then N'VIEW' else N'SYSTEM VIEW' end  

                            end),  

            TABLE_GUID      = convert(uniqueidentifier, null),  

            BOOKMARKS       = convert(bit, 1),  

            BOOKMARK_TYPE       = convert(int, 1 /*DBPROPVAL_BMK_NUMERIC*/),  

            BOOKMARK_DATATYPE   = convert(smallint, 21 /*DBTYPE_UI8 */),  

            BOOKMARK_MAXIMUM_LENGTH = convert(int, 8),  

            BOOKMARK_INFORMATION    = convert(int, 0),  

            TABLE_VERSION       = convert(bigint, ObjectPropertyEx(o.id, 'objectversion')),  

            CARDINALITY     = x.rows,  

            DESCRIPTION     = convert(nvarchar(1), null),  

            TABLE_PROPID        = convert(int, null)   

      

        from    sysobjects o left join sysindexes x on o.id = x.id and x.indid in (0,1)  

        where   o.name = @table_name  

        and     o.type in ('U','V','S')  

        and permissions(o.id) <> 0) as t  

  

    where   (@table_schema is null or @table_schema = TABLE_SCHEMA)  

    and     (@table_type is null or @table_type = TABLE_TYPE)  

    order by 4, 2, 3  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

martian6125

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值