Revover MS SQL 2000 From Log File (last 4 Hours)

Mar 24, 2004

Sorry in advance for the stupid question but I am not a technical expert at all!!!

I made a backup from a SQL-Server 2000 DB 3 days ago. Today data have been deleted from the system and they should be recovered. I have a full recovery model.

I tried to restore the DB but before I made a new backup (Just in case) I hope that was no error????

Is there a way to restore the DB from the log file but just restore the last 4 hours?

Thanks
A

View 1 Replies


ADVERTISEMENT

Adding Hours, Minutes, Seconds (SQL 2000)

Feb 21, 2007

Hi There,

I would like to find the sum of a column with a date format of '01:10:10' which is the hours:minutes:seconds from multiple rows.

For instance, "01:50:10" + "01:20:5" = "3:10:15"

Any ideas?

Using SQL 2000

View 5 Replies View Related

Transact SQL :: To Display Days Hours Mins Format Based On Business Hours

Apr 22, 2015

I want to display Days Hours Mins Format.

I am Having two columns Like below,

Col1 (in days)    col2 (In Hours : Mins)
3days  4:5 

In this first have to  add Col1 and Col2 (Here one day is equals to 9 hours ) so the addition is 31.5

From this 31.5 I should display 3 Days 4 Hours 30 Mins because 31.5 contains 3 (9 hours) days 4 Hours and .5 is equals to 30 mins.

View 6 Replies View Related

Breaking Down Total Hours Worked Into Day And Evening Hours

Sep 21, 2006

I have data coming from a telephony system that keeps track of when anemployee makes a phone call to conduct a survey and which project numberis being billed for the time the employee spends on that phone call in aMS SQL Server 2000 database (which I don't own).The data is being returned to me in a view (see DDL for w_HR_Call_Logbelow). I link to this view in MS access through ODBC to create alinked table. I have my own view in Access that converts the integernumbers for start and end date to Date/Time and inserts some otherinformation i need.This data is eventually going to be compared with data from someelectronic timesheets for purposes of comparing entered hours vs hoursactually spent on the telephone, and the people that will be viewing thedata need the total time on the telephone as wall as that total brokendown by day/evening and weekend. Getting weekend durations is easyenough (see SQL for qryTelephonyData below), but I was wondering ifanyone knew of efficient set-based methods for doing a day/eveningbreakdown of some duration given a start date and end date (with theday/evening boundary being 17:59:59)? My impression is that to do thiscorrectly (i.e., handle employees working in different time zones,adjusting for DST, and figuring out what the boundary is for switchingfrom evening back to day) will require procedural code (probably inVisual Basic or VBA).However, if there are set-based algorithms that can accomplish it inSQL, I'd like to explore those, as well. Can anyone give any pointers?Thanks.--DDL for view in MS SQL 2000 database:CREATE VIEW dbo.w_HR_Call_LogASSELECT TOP 100 PERCENT dbo.TRCUsers.WinsID, dbo.users.username ASInitials, dbo.billing.startdate, dbo.billing.startdate +dbo.billing.duration AS EndDate,dbo.billing.duration, dbo.projects.name ASPrjName, dbo.w_GetCallTrackProject6ID(dbo.projects.descript ion) AS ProjID6,dbo.w_GetCallTrackProject10ID(dbo.projects.descrip tion) AS ProjID10,dbo.billing.interactionidFROM dbo.projects INNER JOINdbo.projectsphone INNER JOINdbo.users INNER JOINdbo.TRCUsers ON dbo.users.userid =dbo.TRCUsers.UserID INNER JOINdbo.billing ON dbo.users.userid =dbo.billing.userid ON dbo.projectsphone.projectid =dbo.billing.projectid ONdbo.projects.projectid = dbo.projectsphone.projectidWHERE (dbo.billing.userid 0)ORDER BY dbo.billing.startdateI don't have acess to the tables, but the fields in the view comethrough as the following data types:WinsID - varchar(10)Initials - varchar(30)startdate - long integer (seconds since 1970-01-01 00:00:00)enddate - long integer (seconds since 1970-01-01 00:00:00)duration - long integer (enddate - startdate)ProjID10 - varchar(15)interactionid - varchar(255) (the identifier for this phone call)MS Access SQL statement for qryTelephonyData (based on the view,w_HR_Call_Log):SELECT dbo_w_HR_Call_Log.WinsID, dbo_w_HR_Call_Log.ProjID10,FORMAT(CDATE(DATEADD('s',startdate-(5*60*60),'01-01-197000:00:00')),"yyyy-mm-dd") AS HoursDate,CDATE(DATEADD('s',startdate-(5*60*60),'01-01-1970 00:00:00')) ASStartDT,CDATE(DATEADD('s',enddate-(5*60*60),'01-01-1970 00:00:00')) AS EndDT,DatePart('w',[StartDT]) AS StartDTDayOfWeek, Duration,IIf(StartDTDayOfWeek=1 Or StartDTDayOfWeek=7,Duration,0) ASWeekendSeconds,FROM dbo_w_HR_Call_LogWHERE WinsID<>'0'

View 3 Replies View Related

Converting Decimal Hours To Hours And Minutes

May 13, 2008

I have a float variable that holds a decimal number of hours.

So 1.5 equals 1 hour 30 minutes.

I need to change this to the format 1:30

Any idea how to do this?

View 10 Replies View Related

DB File Size Limit With SQLServer 2000 In Small Business Server 2000

Mar 15, 2006

Thanks in advance. What is maximum SQL Server database (*.mdf) file size with SQL Server 2000 as part of Microsoft Small Business Server 2000? (Database files were limited to 10 GB in SBS 4.5 with SQLServer 7.0... has this changed?).

View 1 Replies View Related

How To Create, Install And Deploy Dts File For Sqlserver 2000 And Dtsx File For 2005 ?

Apr 24, 2007

Hi,



I am looking for tutorials about how to create dts et dtsx files.

Thanks for your help.



Arioule.

View 1 Replies View Related

How Will I Truncate DB Log File In SQL 2000?

Jul 8, 2003

How will I truncate DB log file in SQL 2000?

View 2 Replies View Related

Specifying Table To File In SQL 2000

Jun 13, 2006

Following on from http://forums.databasejournal.com/showthread.php?t=42959 it has been asked for the ability to specify certain tables to be in certain database files, but I'm unaware this can be done. They want the archive tables to be on a seperate volume (on a cheaper set of disks/lower performing RAID set, for example) to the live data.

Can this be done with SQL 2000 Enterprise server?

Pax

View 3 Replies View Related

File From Oracle To Sql 7/2000

May 2, 2001

I am trying to take a table from Oracle and put it in a file and then
BCP this file to SQL. No problem until I get to the text column coming from
the Oracle table. I am using the vertical bar (pipe delimited) row and column delimeter options. But when I get to the Notes field I only get one
character per field???? I don't know what else to try.

Any thoughts?

I am transferring from Oracle 8.0 to my pc using SQL 2000. However the server has SQL 7.0 where the actually DTS package will run.

Thanks in advance for any help.

Dianne

View 2 Replies View Related

Shrinking 2000 Log File

Aug 13, 2001

I have a database that was loaded with large amounts of data before today. I backup up the db and trans log. presently the DB file is 328 while the trans log show 428 meg with only 28 meg being used. If I try to shrink either the database or the log files, the log file wil not shrink.. It tells me to set it to a minimum of 28 meg but still not shirnk. I realize this was a problem in 7, any quick fixes, in a hurry. Running SQL 2000 SP1

View 1 Replies View Related

Import .dat File To SQL 2000

Oct 17, 2005

My company designs our own banking software written in Progress. Currently twice a year (during our releases) we require our bank customers to run a program on their system that pulls certain data and dumps it to a .dat file. This .dat file was then imported (using another progress program) into a Progress database that our development team created (called stats.db) so we could have access to certain information regarding the customer's software/hardware set-up and utilization of programs,etc. This stats.db is now going away as we have a centralized SQL database for all customer information. The new process will be for our customers to send in their .dat files, they would be forwarded onto me, then I will need to import them into our SQL database. I am struggling in finding a way to do this. Our .dat files contain one field that holds the information, therefore the data is not delimited in such a way that I can just pull it into Excel, Access, CSV, etc. How can I go about pulling data out of these .dat files into a view/table in SQL for importing?

I am at a total loss and have spent hours researching this issue. Any help will be greatly appreciated. Thanks...

View 3 Replies View Related

SQL M.P.s - 1 Day = 24 Hours??? Or 24 - 48 Hours???

Jun 28, 2001

We have a few Servers that have space issues that need full DB Backups every day. As a result, we have to carefully watch how many DB Backup files we keep on the Server. On the Maintenance Plan, if I set the 'Delete files older than:' to '1' 'Day', will this delete anything over 24 hours old? What I have noticed, is that it tends to delete on Tuesday anything that was created on Sunday, but not Monday. Therefore, I am assuming that instead of '1 Day' being 24 hours, it is anything less than 47 hours and 59 minutes...

Is my assumption correct or do I need to look at something else. Thanks!

Billy

View 1 Replies View Related

Generate A Xml File From Sql Server 2000?

Jul 10, 2006

hi there.
i'm using asp.net 2 page i'm accessing a table consists of 100 thousands rows and its slow and i'm wondering instead of accessing directly to the table how about if i access via xml ?
generate xml and cache it and use the xml file rather going to sql server database?
has anybody have any help on this?
the steps invloved:
1) first generate a xml file from table something like this:
select * from dbo.LOOK_UP FOR XML AUTO, XMLDATA ?SELECT * FROM dbo.LOOK_UP  FOR XML RAW, ELEMENTS  ?SELECT * FROM dbo.LOOK_UP FOR XML AUTO ?
which one should i use and how do i access after i gnerate a xml file
 
thanks.
 

View 5 Replies View Related

Sql Server 2000 To Mdf Database File

Apr 11, 2007

I know I know this is kind of reverse thing I am asking.but as I am working on project and it is very time consuming to connect every time I want to for modifying database or dataset. 

View 1 Replies View Related

SQL Server 2000 File Upload

Oct 9, 2007

hi
i am using VS2003 and .net 1.1. i need to upload a cert file into sql server 2000. code is as follows, i am not sure if this code is working or not, its not giving any error nor throwing any exception. in this function i am only converting ther .cer file to byte array. and in other function i am passing this byte to a stored procedure. in stored procedure i have declare a parameter as "@cert binary". i cant see the binary data in sql server 2000, its only showin <binary> in that column. i need to download this file now, how can i do that. Dim selectedCert As HttpPostedFile
Dim certLength As Integer
Dim isValid As Boolean = False
'Dim imageType As String
'Dim fileUpload As System.Web.UI.HtmlControls.HtmlInputFile = .FindControl("fileUpload")
selectedCert = fileUpload.PostedFile
certLength = selectedCert.ContentLength
'imageType = selectedCert.ContentType
Session.Add("isDefaultLogo", 0) ' To check if default logo is used
If fileUpload.PostedFile.ContentLength = 0 Then
' DO NOTHING
ElseReDim binaryCert(certLength - 1)
'check if there a certificate file or not
If (selectedCert.ContentLength = 0) Then
' DO SOMETHING
Else
selectedCert.InputStream.Position = 0
selectedCert.InputStream.Read(binaryCert, 0, certLength - 1)
Response.Write(selectedCert.ContentType.ToString)
If (selectedCert.ContentType.ToLower <> "application/x-x509-ca-cert") Then
lblMsg.Visible = True
lblMsg.Text = "Only Certificate (*.cer) files are allowed."
isValid = True
Return False
End If
End If
End If
If isValid Then
TryDim strm As IO.FileStream = System.IO.File.Open(System.IO.Path.GetFullPath(fileUpload.PostedFile.FileName), IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.ReadWrite)ReDim binaryCert(strm.Length - 1)
strm.Read(binaryCert, 0, strm.Length)
strm.Close()Catch ex As Exception
Return False
End Try
End If
 
thnx in advance
cheers

View 3 Replies View Related

How To Move Primary Log File In SQL 2000

Dec 5, 2001

Is there a way to move the primary log file for a database to another drive without doing this with a restore database operation? I have added a second log log file but now I would like to delete the one that was created when the database was created.

View 1 Replies View Related

Convert Flat File To SQL 2000

Oct 14, 2003

I have a table in a flat file that I need to convert to SQL Server 2000. Within this file are 4 different record definitions (all are similar but with different lengths).

I have experience converting files that are of 2 different record definitions, but never with this many. What kind of data migration techniques are available for such a process? I need to be able to get these 4 different definitions into 4 different tables.

It is coming from a COBOL program in UNIX.

Any help would be greatly appreciated.

View 2 Replies View Related

SQL Server 2000 Log File Size

Nov 10, 2006

Am running several databases on SQL server 2000.
Have several overnight jobs for interface and maintenance, etc.
Log file on one specific database increases in size 10 fold overnight. Unable to trace why.
I have a job to truncate the logs before the final overnight backup. Several times a week the job hangs - on nights when log file expands, so it is a pain. Able to resolve the issue after the event, but do not understand why the log file increases in size (at that time) in the first place. No other activity on the server at the time.

View 2 Replies View Related

Attaching A SQL Server 2000 DB W/out The Log File

Oct 31, 2001

How do I reattached a SQL server database if the log file was not backed up and none is available. Our server went belly up and the backups were only copying the *.MDF files. The log files were not being included in the backup for some reason.

I know in version 7.0 you could reattach with out the log file but I am having a more difficult time figuring out how to get around thin in SQL 2000. Anybody got any ideas???

Thanks!!!

View 1 Replies View Related

Redirect Output To A File In MS SQL 2000

Jun 8, 2007

Hi,

Does someone know how to spool output of a query/procedure to a file? I'm running MS SQL 2000 and will have to set up an automated job which will email this file to interested parties. Here is the procedure that I'm executing:

IF EXISTS (SELECT 1 FROM sysobjects WHERE [name] = 'sp_db_stats' AND type = 'P')
DROP PROC sp_db_stats
GO

CREATE PROCEDURE sp_db_stats

@DBName sysname = '*'
AS
DECLARE @DBStatus int,
@dbid int

DECLARE DBs CURSOR FOR
SELECT name, dbid, status
FROM master..sysdatabases
FOR READ ONLY

OPEN DBs
FETCH NEXT FROM DBs INTO @DBName, @dbid, @DBStatus
WHILE @@FETCH_STATUS = 0

BEGIN
exec master..sp_helpdb @DBName

NextDB:
FETCH NEXT FROM DBs INTO @DBName, @dbid, @DBStatus
END

CLOSE DBs
DEALLOCATE DBs

NoCursor:
RETURN

Thanks in advance!
-Alla

View 10 Replies View Related

Importing Data Into MS SQL 2000 From XML File

Jun 9, 2006

Hi Everone,I'm writing a script to import data from an XML file, and this tutorial isreally an awesome guide :http://www.kbalertz.com/Q316005/Imp....Component.aspx ... problemthough is here's a snippet of my XML file:<planets><sun rise="6:23" set="20:33"/><moon rise="18:54" set="4:26"/><mercury rise="7:50" set="22:11"/><venus rise="4:24" set="17:38"/><mars rise="9:45" set="23:40"/><jupiter rise="17:23" set="4:20"/><saturn rise="10:09" set="23:53"/><uranus rise="1:38" set="13:10"/><neptune rise="0:23" set="11:13"/><pluto rise="20:38" set="7:25"/></planets><moon><phase date="7/6/2006" text="Waxing Gibbous">9</phase><phase date="7/7/2006" text="Waxing Gibbous">10</phase><phase date="7/8/2006" text="Waxing Gibbous">11</phase><phase date="7/9/2006" text="Waxing Gibbous">12</phase><phase date="7/10/2006" text="Waning Gibbous">14</phase></moon>The tutorial seems to work well with entries in XML that look like this:<nighttime><txtshort>A moonlit sky</txtshort><txtlong>A moonlit sky</txtlong><weathericon>33</weathericon><hightemperature>100</hightemperature><lowtemperature>74</lowtemperature><realfeelhigh>108</realfeelhigh><realfeellow>74</realfeellow></nighttime>But when the XML file has more info (not sure technically what it's called)like the date and text options above in the phase tag, I'm not sure how toimport these into MS SQL. In MS Access I did do an import from this XMLfile, but alas it didn't see these entries in the phase tags either.Suggestions? I'm trying to use the XML Bulk Load component, but I'm sureI'm missing something. Thanks for any suggestions ...Sam---Sam Alexander - sam.alexander(at)sidebandbbs(dot)comhttp://www.samandflip.com or telnet://sidebandbbs.com---"Data is not information, Information is not knowledge, Knowledge is notunderstanding, Understanding is not wisdom." -- Cliff Stoll--- Synchronet 3.13b-Linux NewsLink 1.84--[SideBand BBS - telnet://sidebandbbs.com]--

View 3 Replies View Related

File Import To SQL Server 2000

Jul 20, 2005

Hi all,I have a file with an extension of .sdf. I "believe" it is a text fileof some sort but I am uncertain. The source agency hasn't returned anyof my calls so I'm wondering if anyone is familiar with this extension?I'd like to import the file into my database - when I use DTS and chosea text format, regardless of what delimiter I choose, the format isstill really ugly. when I pull it up in a huge text editor, it is hardfor me to tell what it is there.I saw in one of my searches that it could be a comma delimited (it'snot) .. could be a unisys file? I know it's not much information to goon - but where should I start in trying to get this into my databasewithout knowing the format? Any suggestions would be greatlyappreciated.Thanks!Bethany*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 1 Replies View Related

How To Recover From Mdf File (SQL Server 2000)

Dec 22, 2006

Hi,

My database corrupted because when I was running an update query, there is a power failure. After the computer booted, I cannot open the database anymore, it just not responding. Then I stop the sql server service, and tried to rename the .mdf and .ldf. After that it worked normally, but I need the data from the corrupted mdf file, I tried to attach the database but it just hanged. I even tried to attach without the .ldf file but it didn't work either, so I concluded that the problem is with the mdf file.

Is there any way to recover my data ??

Thanks in advance

Regards,

Edwin

View 8 Replies View Related

How Does Bcp.exe File Differ For SQL 2000 And SQL 2005 ?

Mar 28, 2008

Hi,

I am trying to bcp from a remote server. They have bcp.exe file installed . I guess this is for SQL 2000 server.

I am able to bcp data from SQL 2000 server . But I am unable to bcp data from SQL 2005 server which has servername like "servernameinstancename"

I am getting error " Server does not exists or access denied"


How does the bcp.exe file differ for SQL 2000 and SQL 2005 servers? Do I need to install anything to make this workl?

View 1 Replies View Related

SQL Server 2000 Attach Db Without One .ldf File

Nov 17, 2007

Dear All,


We have a DB on sql server 2000 64 bit and the build is 2187.

The database consisted of two transaction log files and several data files at the time we took backup. However, the backup taken was a cold backup (backup of files through OS). In this backupset, one transaction log file was skipped due to some error...... Now I want to restore the database for referring to some history data. Will I be able to attach the database with all MDF and one of the transaction log files.??

I heard this kind of recovery is not possible. If anybody can post some solution , I would be grateful...!!


Regards,

Chetan

View 2 Replies View Related

Please Help---Log File Will Not Reduce In SQL 2000 Database

Sep 26, 2007

My Database plan is as follows:

Full Database backup every night, Full recovery mode.
T-Log backups , every 4 hours.

both are appended to media,

there are no active transactions,

but Log file will not shrink or reduce in size.

what would you suggest.

Thanks,

View 3 Replies View Related

SQL Showing Last 24 Hours

Oct 31, 2005

SELECT sysjobs.name, sysjobservers.last_run_outcome, CONVERT(varchar(8), sysjobservers.last_run_date, 112) AS LastRunDate, CONVERT(varchar(8),
sysjobservers.last_run_time, 8) AS LastRunTime, GETDATE() AS CurrentDateTime
FROM sysjobs LEFT OUTER JOIN
sysjobservers ON sysjobs.job_id = sysjobservers.job_id
WHERE (sysjobservers.last_run_outcome = 0) AND (CONVERT(varchar(8), sysjobservers.last_run_date, 112) >= DATEADD(day, - 1, GETDATE()))

I am wanting a similar solution, I need to convert an "int" to a time format, when I use this where ">= DATEADD(minute, - 720, GETDATE())" for the last_run_time I get this error:

Syntax error converting datetime from character string.

View 3 Replies View Related

8 Hours To Add A Bit Column

Jul 1, 2004

I ran the following:

ALTER TABLE Recipients ADD Obscene BIT NOT NULL DEFAULT 0


On a table with 80 million records. It's been running for 8 hours and counting now. This is ridiculous. No one else is using this server.

Server configuration:
SQL Server 2000 Enterprise Edition with SP3a
2 GB RAM
3.0 GHz P4 with hyperthreading
SCSI RAID

Any ideas why this is taking so long? Can I find out what it's doing? Is there anything I can do to make it go faster?

View 13 Replies View Related

28+ Hours To Shrink?????

May 15, 2008

My database is current 135GB. I have been running the following:

DBCC SHRINKFILE([database_data],2)
DBCC SHRINKDATABASE ( [Database],20,TRUNCATEONLY)

It's been running for 28 hours. Should it be taking this long? If I stop the shrink, will it need to rollback?

Thanks!

View 2 Replies View Related

Run Commands Only Between Hours

Feb 29, 2012

I have a job that runs between the hours of 10 PM and 9 AM. It launches a controller stored procedure that will call other stored procedure until the entire process is done.I would like the controlling stored procedure to only call the steps between the hours of 10PM and 9AM also.. So at 8:59 AM it will start the next step, but at 9:00 AM it will exit.

View 6 Replies View Related

Storing Hours

Mar 17, 2004

I use SQL 2K with an Access 2000 project as front end. I have four date fields in a table. The first one should contain a date (eg 20th of February), the second one a starting hour (eg 8:00h), the third one the finishing hour (eg 10:00h) and the fourth should calculate the difference between the second and third column.
So I created four datetime fields. Storing a date in the first column is no problem, but storing only hours doesn't seem to do what I want. When I enter 8:00 from within the Access, it is stored 1/1/1900 8:00 in SQL Server. How can I make sure that the hours are saved with the date of the second column, so either as 8:00 without further information or as eg 20-2-2004 8:00?

View 14 Replies View Related

Sum Hours Per Cost

Apr 21, 2015

I am querying a database that has hours worked listed by pay rate. I want to return sum of hours per pay rates I have been given but hours are stored in multiple columns. So If I run the below query for one worker it returns.

HoursBill_rate_1 Hours_2Bill_rate_2
34.2610.26 0.000.00
5.7410.26 5.689.67

I want to report to the business:

40hrs 10.26
5.68 9.67

The query I have written is below:

Select Sum(Hours_1) As Hours,Bill_rate_1,Sum(Hours_2) as Hours_2,Bill_rate_2--,Hours_3,Bill_rate_3
From Valid_Timesheets
Where (Department = '938' and tax_period = 3 and tax_year = 2015 AND PERSONNEL_REF = '991A001198') and
((Bill_Rate_1 = £10.26 or
Bill_Rate_1 = £9.67 or
Bill_Rate_1 = £8.27 or

[Code] ....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved