选择显示字体大小

用sql语句来建立跟踪的问题

下面是我用sql的事件探察器设置跟踪,并生成的sql脚本
 现在有几个问题:
 
1.这个跟踪不会产生数据,用:
  select * from ::fn_trace_getinfo(1)
 可以看到状态是在运行,但 c:\test.trc 始终是空文件 
 
2.在事件探察器中设置筛选时,objecttype 的说明是对应sysobjects 表的 type 列,该列是字符型,但我输入字符时要求是数字,这个数字从那里查?
 
 3.如果只产生对 insert,update,delete 语句成功的跟踪事件应该如何设置呢? 在 事件探察器 中无相关设置,用语句设置的话只找到事件号 28, 在执行 select、insert 或 update 语句之前发生
 
 4.用事件探察器建立的跟踪,可以将跟踪结果保存到表中,但我下面生成的sql脚本却不支持这个功能
--*/
/****************************************************/
/* created by: sql profiler                         */
/* date: 2004/06/19  16:50:05         */
/****************************************************/

-- create a queue
declare @rc int
declare @traceid int
declare @maxfilesize bigint
set @maxfilesize = 5 
-- please replace the text insertfilenamehere, with an appropriate
-- filename prefixed by a path, e.g., c:\myfolder\mytrace. the .trc extension
-- will be appended to the filename automatically. if you are writing from
-- remote server to local drive, please use unc path and make sure server has
-- write access to your .network share
exec @rc = sp_trace_create @traceid output, 0, n’c:\test’, @maxfilesize, null 
if (@rc != 0) goto error
-- client side file and table cannot be scripted
-- writing to a table is not supported through the sp’s
-- set the events
declare @on bit
set @on = 1
exec sp_trace_setevent @traceid, 12, 1, @on
exec sp_trace_setevent @traceid, 12, 12, @on
exec sp_trace_setevent @traceid, 12, 14, @on

-- set the filters
declare @intfilter int
declare @bigintfilter bigint
exec sp_trace_setfilter @traceid, 10, 0, 7, n’sql profiler’
set @intfilter = 100
exec sp_trace_setfilter @traceid, 22, 0, 4, @intfilter
set @intfilter = 1
exec sp_trace_setfilter @traceid, 23, 1, 0, @intfilter
exec sp_trace_setfilter @traceid, 35, 1, 6, n’pubs’

-- set the trace status to start
exec sp_trace_setstatus @traceid, 1
-- display trace id for future references
select traceid=@traceid
goto finish
error: 
select errorcode=@rc
finish: 
go


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons