I have created stored procedure for checking the cpu usage and connection string.
----check the number of users---
EXEC sp_who2 'Active'
-----check the number of connection----
DB_NAME(dbid) as DBName,
COUNT(dbid) as NumberOfConnections,
loginame as LoginName
dbid > 0
for above script I have created one job which will run every 1 hr and that information will be stored into the txt files through
But the problem is the all the information is stored in one file.
actually what I want, for today when job will be started it will create one txt file and all the data will be stored in the same file and tomorrow again the job will start the samething happen.
So everyday I want to create new txt files and when the job will start the data will be stored in that file.
Is there any script or anyother solution, please share with me.
I just wouldn't do this. You're creating a nightmare for yourself when someone asks to see the data. Just store the data in a table reserved for DBAs and call it a day.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:
How to post code problemsHow to post performance problemsForum FAQs