如何用SQL语句在两个数据库间复制存储过程
--1.在目标服务器上建立如下对象(被同步的服务器)
if exists (select * from dbo.sysobjects where id = object_id(N'[sys_syscomments_bak]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [sys_syscomments_bak]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_process_object]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[p_process_object]
GO
--创建辅助处理的表
create table sys_syscomments_bak(name sysname,xtype char(2),number smallint,colid smallint,status smallint,ctext varbinary(8000))
go
exec sp_configure 'allow updates',1 reconfigure with override
go
--创建处理的存储过程
create proc p_process_object
as
set xact_abort on
exec sp_configure 'allow updates',1 reconfigure with override
begin tran
--先删除系统表中的旧记录
delete a
from syscomments c,sysobjects o,sys_syscomments_bak ob
where c.id=o.id
and o.name=ob.name and o.xtype=ob.xtype
--再插入新记录到系统表中
insert syscomments([id],[number],[colid],[status],[ctext])
select o.[id],ob.[number],o
相关文档:
如何修改SQL Server的连接数
我把SQL Server 7.0的用户连接数设为1后,数据库就再也连不上了,所以也没办法修改连接数
请问有什么办法能修改连接数?
在server 的属性里面有个connetctions 的
maximun concurr ......
SQL分类:
DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE)
DML—数据操纵语言(SELECT,DELETE,UPDATE,INSERT)
DCL—数据控制语言(GRANT,REVOKE,COMMIT,ROLLBACK)
首先,简要介绍基础语句:
1、说明:创建数据库
CREATE DATABASE database-name
2、说明:删除数据库
drop database db ......
1.建表语句:create table
用法: create table 表的名字 (字段1, 字段2,。。。。)
举例:例如创建一个学生成绩表,包含的字段有,学生id,姓名,性别,班级,成绩create table score(
create table score(
sid nvarchar(10) primary key,
sname nvarchar(10) not null,
sex nvarchar(2),
sc ......
在有关数据库的项目开发中,编码,bug修改等等,都需要查看操作相关的SQL文,如果SQL文比较复杂的话,我们自己排版非常麻烦,同时也很花费时间。可能有的公司自己开发了格式化工具或者购买了格式化工具软件。有了格式工具我们就节省了排版时间。
介绍一下SQLinFormpro_Desktop(htt ......
计算间隔时间:
select f_date,f_cstime,f_cetime, (((SYSDATE- TO_DATE(f_date||f_cstime,'YYYYMMDDHH24MISS')) * 86400000)-((SYSDATE- TO_DATE(f_date||f_cetime,'YYYYMMDDHH24MISS')) * 86400000))/1000 CURRENT_MILLI from ycsq_t_hauthlog where f_cstime<>'999999'
将字符串转换成日期类:SYSDATE- TO_ ......