SQL语句得到存储过程关联哪些表名
SELECT DISTINCT '['+user_name(b.uid)+'].['+b.name+']' AS 对象名,b.type AS 类型
from sysdepends a,sysobjects b
WHERE b.id=a.depid
AND a.id=OBJECT_ID('过程名');
EXEC SP_DEPENDS '过程名';
相关文档:
--SQL Server:
Select TOP N * from TABLE Order By NewID()
--Access:
Select TOP N * from TABLE Order By Rnd(ID)
Rnd(ID) 其中的ID是自动编号字段,可以利用其他任何数值来完成,比如用姓名字段(U ......
今天在用JTDS连接SQL Server 时候,遇到几个问题,记录如下:
error while performing database login with the jtds driver:
network error ioexception:connection refused: connect
然后查看端口,原来是1433端口未打开,然后在SQL Server configuration Manager下的TCP\IP中启用1433端口,重启SQL Server服务,netst ......
--聚合函数
use pubs
go
select avg(distinct price) --算平均数
from titles
where type='business'
go
use pubs
go
select max(ytd_sales) --最大数
from titles
go
use pubs
go
select min(ytd_sales)& ......
查看回收站中表
select object_name,original_name,partition_name,type,ts_name,createtime,droptime from recyclebin;
恢复表
SQL
>flashback table test_drop to before drop;或
SQL
>flashback table "BIN$b+XkkO1RS5K10uKo9BfmuA==$0" to befor ......