Sunday, June 16, 2013

[SQL Server 2008 issues] Collect data on the basis of timestamp from a table in a view

[SQL Server 2008 issues] Collect data on the basis of timestamp from a table in a view


Collect data on the basis of timestamp from a table in a view

Posted: 15 Jun 2013 05:54 PM PDT

Hi,I am having data in a table in the form[code="other"]L_Limit U_Limit Asset Timestamp10 20 1000 2013-06-14 16:52:57.91020 30 1500 2013-06-14 16:52:57.91030 40 2200 2013-06-14 16:52:57.91010 20 2000 2013-06-15 18:52:57.91020 30 1300 2013-06-15 18:52:57.91030 40 2100 2013-06-15 18:52:57.91010 20 3000 2013-06-16 18:20:27.91020 30 2300 2013-06-16 18:20:27.91030 40 1100 2013-06-16 18:20:27.910[/code]i.e. a Job appends data(i.e. value of asset) for same ranges 10 to 20,20 to 30 and 30 to 40 everyday when I run a job schedule. This data will be stored on a daily basis for months.Also, this limit range is also saved separately in 'Range' table as columns:[code="other"]Lower_Limit Upper_Limit10 2020 3030 40[/code]My requirement is to show this data in this format in a view to show asset value on 3 days i.e. Today, before 7 days, before 30 days:[code="other"]L_Limit U_Limit Asset_Today Asset_Before7Days Asset_Before30Days10 20 20 3030 40[/code]Please suggest how can I get data in this format?Thanks in advance.

SQL Server transaction log backup procedure using batch file.

Posted: 14 Jun 2013 08:33 PM PDT

Hi Guys,Please provide sql server transaction log backup procedure to perform the backup automatically using batch file and that job will be run using Windows task scheduler.Please do not give third party tool reference i want it only by using batch file.Thanks........Reply

Backup SQL 2008 Small DB-Need Profesional Help

Posted: 15 Jun 2013 03:40 AM PDT

I am not an expert in SQL and our system crashed. The backup we set up did not work.Two our RAID 5 hard disk fail and using the services of a Data Recovery company we were lucky to recover the data.I know with all the knowledge is in here and books available I can learn the proper way to backup our data, however in the meantime I need urgent help to make sure our system is backing up properly. Is a very small business. Total size of DB is 500Mg.Please advise if you anyone can help, of course I am willing to compensate.Sorry if this request is outside of the scope of this forum.Thanks a lot.Norbert

Trace flags question.

Posted: 15 Jun 2013 05:48 AM PDT

Hi Guys,Does anyone know what does these trace flags will do when I turn them on? And what does it suppose to do? Please advise.dbcc traceON (8026, -1) dbcc traceon(2551,-1) go dbcc dumptrigger('set',18456) go Thanks,SueTons.

SSIS - What is the best practice for creating a fixed length flat file.

Posted: 29 May 2013 01:36 AM PDT

I am running into the problem of SSIS putting the CRLF in random places at the end of the row. If we assume I am going to start from scratch, can I fix this issue in the Stored Procedure I use in my OLE source, or can I fix it on the SSIS side?I did see the following at MSDN but it did not make any sense to me since I don't see where to do this in the connection manager.[i][b]To make this work so that each row is exactly the same length, you may need to add a zero length column as the last one in the connection manager, and set the row delimiter on that one.[/b][/i]I did read as possibly using the advanced editor on the OLE adapter and adding a column there but how do I create a zero length column. If I send the header in the first row it is going to be at least 1 character.Any help would be greatly appreciated.FYI, I am using ragged right.

Alternative code to achieve the TRY-Catch functionality

Posted: 14 Jun 2013 10:05 PM PDT

Please comment on how to query a alternative code to achieve the TRY-Catch functionality in SQL Server.Also, what are the disadvantages of foreign key constraints in SQL Server.

SHOW OFF DAY

Posted: 14 Jun 2013 08:16 PM PDT

HI i want to show off days in my report my sql data is like this date----------timein------timeout--shift----------eid 2-May-2013--9:20AM---6:17PM-----G-----------17090 3-May-2013--9:09AM---2:01PM-----G-----------17090 4-May-2013--9:03AM---10:41AM----G-----------17090 sql data doesnot show 5 may data in sql or u can say sunday data becouse sunday is off and no employee come on sunday thats why i cant show off day in report please give me a suggestion to look data like this or any month when sunday come report show O in shift and show date just like below date----------timein------timeout--shift----------------eid 2-May-2013--9:20AM---6:17PM-----G----------------17090 3-May-2013--9:09AM---2:01PM-----G----------------17090 4-May-2013--9:03AM---10:41AM----G----------------17090 5-May-2013--------------------------O----------------17090 i hope u under stand Thank in advance

No comments:

Post a Comment

Search This Blog