I'm creating a db to be used to store historical trades which will then be used to report on various strategies/returns etc...
I'm struggling with the correct way to store things like price etc...
Right now I have a table tStock which has pkStockId,StockName,Sector
I have a table tPrice which stores the historical prices which has pkCounter,fkTickerId,fkDate,Price,Volume. This seems odd to me since dates are being repeated. Right now I have about 100 stocks in table tStock and the tPrice table has 10 years of price data for each stock so there are a date range of historical prices which is approximately 252,000 records. That isn't a ton but I will probably end up with 500+ stocks and 20 years of data. Am I storing this correctly? Right now I have the pkStockId indexed and the pkCounter index and I also created an indes using fkTickerId and fkDate. Is there a way to create the tables such that looking up a price is faster? The reason I would like it to be faster is that when analyzing the trade history I need to get the portfolio market values based on various dates so at a certain date I will sum all buys - all sales for every stockid in the portfolio table and then look up the prices for each to get the market value of the portfolio on a particular day. I feel like I am missing something in the design process but don't have experience in this so I am asking for help.
hello, I'm am looking for a smart solution for keeping history of changes in records in my sql database. Not only history of a record but also which user caused the change and when (I have the username in session). for now I added 4 fields to each table: "created by","created on","cancelled by",cancelled on", when the user create a record the 2 first fields are filled and and a user delete a record the two last fields are filled and the record is not really deleted but it won't be shown again (I'm using "where createdby is null"). this solution is taking the performance down and it does not solve the editing record tracking. creating new records and cancelling old ones for editing/changing solve that but than I m having problems with the primary key and relations to other tables. I tried also to use a table that holds records that descirbes every change in records in my tables. it's very hard to search old data that way. I know that oracle databases has a smart solution for history... please someone advise me.. Elad.
When I go to the database restore tab the "backup history" window shows the database backups and log backups from all the way back when the database was initially created. How do I purge the old database and log backup entries?
If there is a history kept somewhere of failover events of a database in an AO group? I have 2 replicas with automatic failover and I'm looking for a history of failovers.
What is the best way to restore a database from a folder of backups (including full, diff and log backups) without using the backup history in msdb?
I have a restore process that restores all backups on a regular schedule in order to fully verify their integrity. To do this, I use the backup history in msdb on each server that I'm monitoring. I had a thought the other day that I would be in trouble if I lost msdb. Then my backup history would only be as good as the last backup of msdb.
What I'd like to do is read a folder of backup files and generate a restore script up to a specified time. Would I use RESTORE HEADERONLY to do this? If so, would I use PowerShell to traverse each file in the folder?
The 'view job history' on Enterprise Manager is showing me only 4 or 5 run histories. I want to see more history on each of the jobs.Even I changed the limit to 10000 lones from 1000 lines on the server properties in the job system option, I am still seeing only the last 4 or 5 histories for each job(there are a total of 70 jobs on the server).Any ideas??Thanks. Reddy.
I have set up a job as sa.After that I changed the sa password.Now I am not able to view the job history since then.Do i need to delete the job and reschedule it?
I have a question about the sql job history. I have a sql 2000 server that was recording all the job history on my sql jobs just fine until the other day. Today I checked the history and the jobs didnt show the past history anymore. Just today's history. So if the job didnt run today there is no history for that particular job. This isn't true, the job was run a few days ago. I know that no one went in and cleard the history on the jobs. What causes this issue, is there a way to not make this happen in the future? Is there a way I can recover the past history for my jobs.
i have my job running every 5 min. I want to view the history log. In job history it shows only few hundreds of records.. But i want to see from beginning. where to view whole log of job history?
hi , i am working on an application using c#, visual studio 2005, sql server 2005. i have a few tables in sql server 2005. i need to save the history. (i.e) all the inserts, updates, and deleats performed on the tables. can any one suggest me how can i achieve that. should i use triggers and save the changes in another table ??? waiting for your suggestion?? thank you
Hi, I want to know where the history of stored procedures stored, I mean yesterday I created one procedure and today I dropped that procedure and recreate it, I checked in sysobjects table name,crdate it shows only the creation date of the procedure. Where can I find the Modification date or something related to procedure history.
I'm using merge replication between 10 SQL server 7.0 SP2 machines. One central server is the publisher and 9 subscribers. I’ve setup an alert to get a message in case of conflicts. I defined it to trigger everytime the performance counter conflicts/sec rises above 0.
After some experimenting this seems now to work reliable, but there is still one point which bothers me. All conflicts are kept in the conflict history and everytime I get a message through the alert the number of copnflicts stated in the message increases by one. Also if I open view replication conflicts in EM all conflicts can still be viewed even those I manually resolved. I can't even find a way to seen which conflicts are new ones and which have been resolved already. Does anybody know a way how to reset this numbers without going through all the conflict tables.
In SQL 6.5, when a scheduled job failed, you could see the error message in the history. In SQL 7.0, it simply tells you which was the last step to run. Is there a place which will report the actual error message generated by the task?
I have set up a job as sa.After few days I changed the sa password.Now I am not able to view the latest job history since then.It says the last run as 'succeeded',but it is not showing the latest history since the time I changed the password.It still shows the previous history only.Do I need to delete the job and reschedule it? Thanks!
I feel stupid asking this because I have worked with SQL Server 6.0/6.5 for serveral years now, but I can't seem to find the task history in 7.0. When I look at a task, I can tell if each step ran or not, but I am used to seeing error messages upon failure by right-clicking on the task and choosing history.
How do I find this in 7.0? In casual looking for a few days, I've come up empty.
Hi I have a full database backup scheduled at 2AM in the morning everyday and If I see that job status in Sql Server logs current activity , it shows me that database has been backed up at 2AM....But the problem is when I go to jobs and try to do a view job history it doesn't give me the details of the job and I didn't clear the job history..Can anyone tell me the reason why it doesn't show me the job history.
Hi - In order to restore a DB on another system I need to know the exact expansion history of the source DB in order to create/expand the devices on the target system the same way... Is there a way for me to see the history of expansions I did on a DB ?? Tanx, Paul
I have several transaction tables on which I need to track the changes. That is I need to maitain the history of changes. Only few column values are changed often.
Which is the best way for tracking the changes.
1.Store the whole record after the change ?
Or
2.Store the ColumnName & its respective old & new value ?
Or any other better.
Note : UI part & SP's will take care of the tracking & no plans for triggers.
I am trying to build a cube to monitor the sales performance. My measure is the sale amount. My dimensions include 1) Time 2) Sale hierarchy (salesman, sales office, region), and 3) Product Line. The problem I have is that when the salesman move from one office to another, the sales occured before this movement should continue to be credited to the old office. Only sales happen after the movement should be credited to the new office. How should I implement the cube to achieve this effectively? We have more that 40,000 sales, about 500 offices, in the company to monitor. So I don't think keeping a copy of the sales hierarchy whenever there is a change is feasible.
I have a table with video information ( Name varchar(30) null, Serial_no int(12) null, Agency_no int(8) null, Agency varchar(30) null ) When items are damaged they are sent to our agency #5. I would like view not only the items that are assigned to our Agency but also what Agency owned this equipment BEFORE us.
Today when I tried to troubleshoot a failed job, I found out that the job history is disappreared. Some jobs' history still exist. Does anybody have idea what happened? How can I fix it?
Is there a place where SQL Server logs errors? When I run my Access MDBagainst a SQL 7 back end, I get ODBC errors, which are sometimes a littledescriptive, sometimes not at all. I usually have to execute code directlyagainst the back end to find out what's really going on. And that's if I'mable to reproduce the error. It would be helpful if SQL logged all errors itgenerates, or if something like that can be set up.Thanks,Neil
Is there a way to increase the number of records preserved in jobhistory? I have 82 jobs on my box, 30 of them run every 20 minutesfor 23 hours a day, every 30 days. Another 30 run once, every 30days. The system seems to have a limit of 50 history records for anyjob that hasn't run since yesterday and purges all history records ifthe job is more than a week old. I didn't know if there might be aconfiguration record buried in MSDB or somewhere else that would allowme to increase this size or perhaps a system SP that prunes jobhistory that I could modify.It isn't critical as the system is set to notify me when jobs fail,but still, I'd like to be able to look at a given day and verify thateverything went normally.
I want to backup an important table every week in creating some history tables.
I would like to create a Dts job or script to create every week a table with the day and month in its name. ( like : [important_table_09-07] , [important_table_09-14],... )