There is no direct option to extract the SQL profile result in Excel or CSV file. We need to use fn_trace_gettable() in SQL server.
Let’s see step by step how to extract SQL profiler result in excel file.
Open SQL server and profiler.
Here I am running below SQL query.
See it in profiler.
Now we need to save this result in .trc file
I saved this with name abc.trc file.
Now open the query window and run the below query
Now we can save the query result in excel or csv file.
select * from fn_trace_gettable('D:\abc.trc',default)
|
Here I am saving it in csv format.
We can add the filer on the function to retrieve the profiler result for the particular user.
select TextData,ApplicationName,LoginName,StartTime,EndTime,
ServerName,NTDomainName,NTUserName from fn_trace_gettable('D:\abc.trc',default)
where NTUserName='Bagesh'
|
Thanks for the informative and helpful post, obviously in your blog everything is good..
ReplyDeletedownload notepad++ for mac
you r a life saver
ReplyDeleteI appreciate you taking the time and effort to share your knowledge. This material proved to be really efficient and beneficial to me. Thank you very much for providing this information. Continue to write your blog.
ReplyDeleteData Engineering Services
Machine Learning Services
Data Analytics Services
Data Modernization Services