Find Out Time Instance Went Offline?

May 18, 2015

Is there anyway that I can find out the time an instance went offline? Does the last entry in the error logs show this? One on my instances went down during the night and I need to know the time this happened if possible.

View 9 Replies


ADVERTISEMENT

Recovery :: How To Find Last Login Date / Time For User DML Activity On Databases On Instance

Jun 22, 2015

How to find last login date/time for user DML acitivity on databases on Instance?

Is there any way we can find our the last login date/time for databases?

Note: 1. We can find if the SQL Trace is running and store.This is not good solution
         2. Audit logins off/on is also not good solution.
         3. Using DMV's also not good option, if reboot sql server instance then historical values can not see.

View 5 Replies View Related

Offline Command Hangs When I Try To Take Database Offline

Apr 10, 2007

Hi, I am relative newbie to SQLServer. When I try to take a user database offline, the query "hangs," with the query processing circle spinning. The Sharepoint 7 application is running on top of the Enterprise SQL Server 2005 db with several logins sleeping and awaiting commands. No errors are generated until I kill the offline command. Anyone have any ideas? Do I need to kill all the connections?

View 2 Replies View Related

Help Writing Query (find The Entry With The Closest Time Given A Time)

May 26, 2005

Hi,

I have a table which has a few fields, one being "datetime_traded". I need to write a query which returns the row which has the closest time (down to second) given a date/time. I'm using MS SQL.

Here's what I have so far:


Code:


select * from TICK_D
where datetime_traded = (select min( abs(datediff(second,datetime_traded , Convert(datetime,'2005-05-30:09:31:09')) ) ) from TICK_D)



But I get an error - "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.".

Does anyone know how i could do this? Thanks a lot for any help!

View 2 Replies View Related

How To Find Point In Time Or Last Committed Time In Log Backup

Jun 25, 2015

I am reading about the RESTORE command to a point in time using logs, I would like to know the minimum point in time recovery for a backup image using T-SQL command before applying a log restore and what are the log ranges needed for the restore during restore.

 My Version 2008 R2

View 7 Replies View Related

How To Find Out Date/time When Row Was Updated Last Time

Jan 15, 2002

Hello,
we need to track date/time of last update for each record in a table.

As we understand it, we can't use field type Timestamp as this type does
not use dates/times.

Is there any SQL function available which we can bind to a column or
do we really have to use triggers?

Greetings from Mannheim, Germany
Ricardo

View 2 Replies View Related

How To Find Out Date/time When Row Was Updated Last Time

Jan 15, 2002

Hello,
we need to track date/time of last update for each record in a table.

As we understand it, we can't use field type Timestamp as this type does
not use dates/times.

Is there any SQL function available which we can bind to a column or
do we really have to use triggers?

Greetings from Mannheim, Germany
Ricardo

View 1 Replies View Related

How To Find Instance Name

Apr 1, 2007

Hi



I just start to learn SQL server now. I am trying to migrate data from oracle to SQL server 2005 using SQL server migrant assistant for Oracle. But I don't know how to fiill this connection details








SQL Server host:

<ServerHost>


SQL Server port
(leave empty if default):

<8888>


SQL Server instance name
(leave empty if default):

<your_instance>


Target database:

<your_db_name>


Target schema:

dbo (by default)


User name:

<your_username>


Password:

<your_password>



How to find these properties? Anyone can help?



Thanks



Li

View 14 Replies View Related

Find Out If Instance Is Stopped

Jan 10, 2008

I'm running an SSIS package and I want to be able to skip instances that are stopped. Is there anyway that I can do a SELECT on some SERVERPROPERTY that would tell me if the instance is stopped?

Also, I was wondering about a delete from each table. I have each row timestamped in multiple tables. What could I do to set up a job to delete from each table rows after a certain timestamp?

Thanks,
Kyle

View 3 Replies View Related

SQL Cant Find Server/instance When Deploying Website.

Mar 11, 2008

Hello All, please be gentle im very new to this stuff..
So if i add a record via a sql datasource using the ConnectDB connection string it adds it the the sql 2005 database called intranet.... If i try to add to it using an onbuttonlick(Code Below) event it comes up with the "An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) "I have set remote connections on and tryed it with TCP/IP and TCP/IP and Named Pipes.   SQL is installed as the default instance.
If  both ways are using the same connection string surely it should work? Im not to sure where i am going wrong here...Here is the code for the on button click event.. 'INSERT NEW EMAIL INTO NEWSLETTER TABLE




1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:

Protected Sub AddEmailButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AddEmailButton.Click
Dim ConSTRING As String = ConfigurationManager.ConnectionStrings("ConnectDB").ConnectionString
'INSERT NEW EMAIL INTO NEWSLETTER TABLE
Dim cn As SqlConnection = New SqlConnection(ConSTRING)
Dim InsertSQL As String = "INSERT INTO Newsletter (Name, Email) VALUES (@Name, @Email)"
Dim cmd As SqlCommand = New SqlCommand(InsertSQL, cn)
cmd.Parameters.AddWithValue("@Name", (TBname.Text))
cmd.Parameters.AddWithValue("@Email", (TBemail.Text))
cn.Open()
cmd.ExecuteNonQuery()
LBLstatus.Text = "Success, Email is now on Mailing List"
cn.Close()

Below is my web.config connection string<connectionStrings>  <remove name="LocalSqlServer" />  <add name="ConnectDB" connectionString="Data Source=10.130.0.11;Initial Catalog=intranet;User ID=XXXXX;Password=XXXXX;"   providerName="System.Data.SqlClient" /> </connectionStrings>
 
Any help on this would be great as im stuck..
Best Regards
Leigh

View 5 Replies View Related

MS SQL Server Service Manager Does Not Find Instance

Jul 23, 2005

I am running Win XP SP2 and MSDE 2000 SP3a. The user is logging on asa POWERUSER. When the user logs on the MSSQLSERVER service starts butthe SQL Server Service Manager, that runs in the system tray, showsthat the instance has not started. The field that displays theinstance name is blank and it is not listed in the drop down list.The MSSQLSERVER service is set to start with a Windows domainadministrator account. The SQL server can be accessed by a remotecomputer through Enterprise Manager. The local programs cannontinteract with the server though.Does anyone know if I could grant some user access rights to allow MSDEto work under a POWERUSER login?

View 2 Replies View Related

SQL Server 2008 :: Find Unused Databases Or When Last Used In A Instance?

Mar 30, 2011

Find unused databases in a instance or when last used or accessed?

I'm on SQL SERVER 2008 R2 64bit -enterprize

I need to find when the databse is last accessed.

View 3 Replies View Related

Transact SQL :: Find Single Largest Table In Entire Instance

Nov 16, 2015

I usually go for the largest datafile and then query in-there...But now I need to automate it for several instances... I need to be able with one script quickly retrieve the top 5 largest tables for the entire instance,not by database...

View 3 Replies View Related

Connecting To Default Instance For The First Time

Mar 16, 2008

I just installed Sql Server 2005, and opened the Sql Server management studio, and the connect to server dialog box popped up, i selected database engine, but what do I put in the server name box? I tried my computer name, and got an error, i tried localhost and got an error, i tried my computer name/localhost and got an error. I installed it as the default instance with windows authentication, and I verified that the sql server service is running, but I always get a login error. Can anyone help me get started?

View 5 Replies View Related

SQL Finding More Than One Instance In Time Frame

Apr 15, 2008

What is the easiest way to write a query statemet to find two or more instances that occur in a 15 minute period? Any help would be greatly appreciated. Thanks.

View 6 Replies View Related

SQL Server 2008 :: Loop Through Date Time Records To Find A Match From Multiple Other Date Time Records?

Aug 5, 2015

I'm looking for a way of taking a query which returns a set of date time fields (probable maximum of 20 rows) and looping through each value to see if it exists in a separate table.

E.g.

Query 1

Select ID, Person, ProposedEvent, DayField, TimeField
from MyOptions
where person = 'me'

Table

Select Person, ExistingEvent, DayField, TimeField
from MyTimetable
where person ='me'

Loop through Query 1 and if it finds ANY matching Dayfield AND Timefield in Query/Table 2, return the ProposedEvent (just as a message, the loop could stop there), if no match a message saying all is fine can proceed to process form blah blah.

I'm essentially wanting somebody to select a bunch of events in a form, query 1 then finds all the days and times those events happen and check that none of them exist in the MyTimetable table.

View 5 Replies View Related

Date/Time Of Latest SQL Server 2005 Instance Restart

Jan 28, 2008



Is the Date/Time of the latest SQL Server 2005 instance restart stored somewhere in the system catalog?
This value is quite relevant when retrieving information on the costliest unused indexes in the instance.

I know of one way of doing this, which is to search the SQL Logs for this info.
This solution is very unwieldy - we recycle the logs daily and we only keep the logs of the last 7 days.

View 4 Replies View Related

Find Time Ranges

May 25, 2008

Find Time Ranges
I have a DateTime field, I need to find out how many records are in 8am-11am, 12pm-5pm, 6pm-7am regardless of date. How can I do this?

View 4 Replies View Related

How To Find Out If Db Was Not Used For N Period Of Time

Dec 15, 2004

Hi,
I want to remove old databases from server.
Any way not running a trace to find if db was not in use for 6 months ?

Thank you
Alex

View 1 Replies View Related

Find Time Ranges

May 25, 2008


Find Time Ranges
I have a DateTime field, I need to find out how many records are in 8am-11am, 12pm-5pm, 6pm-7am regardless of date. How can I do this?

View 3 Replies View Related

Find Time Ranges Records

May 25, 2008

I have a DateTime field, I need to find out how many records are in 8am-11am, 12pm-5pm, 6pm-7am regardless of date. How can I do this?

Kamran Shahid
Sr. Software Engineer(MCSD.Net)
www.netprosys.com

View 2 Replies View Related

Find Querey Execution Time

Nov 22, 2007

Hi!
How can i find the querey execution time in sql 2000.
If u have any article or books online please suggest me.

Thanks!

View 9 Replies View Related

First Time Installing - Can't Find BIDS

Feb 28, 2007

Thank you to all that take the time to read this!

All software is installed on a single development pc. I have a SQL Server 2000 Developer Edition Database that I am using to test a new Accounting System. SQL Server 2000 is the required format. I would like to start developing some SRSS reports against that database. It was suggested that I install the SQL Server 2005 Reporting Services, because I was told 2005 is less buggy and easier to use. I installed SRSS 2005, and only SRSS 2005, and used the Configuration Tool to get it configured properly, I think. I have green checks on everything except "Email Settings" and "Execution Account"

Now, I want to write some reports. BIDS is not under the "Microsoft SQL Server 2005" program group, only "Configuration Tools". I was also told that I could use Visual Studio to write reports. I installed Visual Studio 2005 Standard Edition. When I go start a new project, "Business Intelligence€? is not a project type or sub-type.

What do I need to do so I can either install BIDS or use VS 2005 to write reports?

View 4 Replies View Related

How To Find The Hour Of A Date Time

Oct 22, 2007

i have a query i need to calulate the HH of a datetime field

example


Dateval Need to get







10/01/2007 7:48
10/01/2007 7:00

10/01/2007 7:49
10/02/2007 7:00

10/01/2007 7:50
10/03/2007 7:00

10/01/2007 7:51
10/04/2007 7:00

10/01/2007 7:52
10/05/2007 7:00

10/01/2007 7:53
10/06/2007 7:00

10/01/2007 7:54
10/07/2007 7:00

10/01/2007 7:55
10/08/2007 7:00

View 5 Replies View Related

How To Find Database Table And Their Field Name Run Time.

Jul 8, 2007

 I am using sql server as back end. Through connection string
I am getting database name. But in A dropdown I want to show list of table in
that database. And in another B drop down I want to show fields of table
selected in A dropdown. can any one help in getting the field .

 

View 2 Replies View Related

Query To Find SQL Activity At Specific Time?

Mar 23, 2007

Ok, please pardon my complete ignorance; but I am extremely SQL challenged. I manage the server right now and I am the closest thing to a DBA at the moment with this server.

Here is the problem. I have a job that runs every hour and until last week it was running without any problems. Now, once a day it hangs, and I end up having to restart sql to get it to be functional again. I guess I could just kill the spid, but regardless, it's fails.

It doesn't happen at the same time each day. I thought it was from the backups doing a SQL backup job, but I eliminated that possibility. I can't find what is causing the problem, because the SQL logs just stop at the time that this happens. It's like some other job/query is running and taking all the sql server resources. But I can never catch it when it's happening and I have no event logs or SQL logs to go on.

Is there any query that I can run to find what happened around the specific time the job failed to run? I just need to find what process did what when this job stopped working.

Again, I apologize if my lack of SQL knowledge is making me ask dumb questions, but I am really lost.

Thanks in advanced!

View 3 Replies View Related

T-SQL (SS2K8) :: Find Working Time Of Each Employee

Aug 18, 2015

IF EXISTS ( SELECT TOP 1 1 FROM sys.tables WHERE name = '#EmpHours' )
DROP TABLE #EmpHours;
CREATE TABLE #EmpHours

[Code]....

View 7 Replies View Related

Find The Last Time The Data In A Particular Table Was Changed

Mar 27, 2008



Is there a Tool/Utility/StoredProcedure/Query/View that can tell me the last time the data in a particular table was changed?

That change can be the result of either an ADD , INSERT, or DELETE statement.

I am using SQL Server 2005.

View 3 Replies View Related

Find Time Period For A Type Of Alarm With Overlaps

Apr 18, 2015

I have a dataset (DATA) like this-

Store Start End Type
XXXX 02-03-2015 10:04:00 02-03-2015 10:08:00 1
XXXX 02-03-2015 10:06:00 02-03-2015 10:10:00 2
XXXX 02-03-2015 10:09:30 02-03-2015 10:12:00 1
YYYY 03-03-2015 20:04:00 03-03-2015 20:12:00 1
YYYY 03-03-2015 20:06:00 03-03-2015 20:10:00 2
YYYY 03-03-2015 20:09:00 03-03-2015 20:16:00 1
YYYY 03-03-2015 20:15:00 03-03-2015 20:18:00 2
YYYY 03-03-2015 20:17:00 03-03-2015 20:22:00 2
YYYY 03-03-2015 20:21:00 03-03-2015 20:27:00 1

The output of this file (RESULT) is-

Store Start End Mins of Type 2 only
XXXX 02-03-2015 10:04:00 02-03-2015 10:12:00 00:01:30
YYYY 02-03-2015 20:04:00 02-03-2015 20:27:00 00:05:00

So for each Store (Store is unique in the table), I am rolling up the intervals with overlaps to create a single interval.

Now, for each store, I want to find the time period for purely type 2. So if there is an overlap, type 1 has the dominance. And I want the sum of time period of whatever is left for type 2.

I have written this code but not able to address the overlap issue:

alter table [DATA] add Outage float;
update [DATA]
set Outage = DATEDIFF(SECOND,[Start],[END])
alter table [RESULT] add [Outage_Type1 (%)] float,[Outage_Type2 (%)] float;

[Code] ....

View 11 Replies View Related

First Time User That Can't Find Answer. Need Online Website.

Jan 15, 2007

HI! Thank you for even looking at this question.

I need to get a website up and running for a small group of people. I've had SQL Server for a while, but didn't have any use for it. It came with Visual Studio 2005, which gave me a little know how on scripting. Now, I have Visual Web Developer and what I need to make a web page. I just need to know how to configure all my settings to allow my website to be viewed online by anyone with an internet connection. I'm a person that understands detailed or simple directions, but I can not seem to find directions online. Now, I know what your thinking, but I've never attemped anything like this before. So, please, HELP! I need and want to learn as much as possible.

Thank you, tecfreak213

P.S. also, how do I change or get a web address? Thanks.

View 1 Replies View Related

Data Warehousing :: Find CDC Enabled Time In Database

Aug 11, 2015

How to find the CDC enabled date and time  in database.

View 3 Replies View Related

DB Engine :: How To Find Last Updated Change Tracking Time

Jul 30, 2015

In a change tracking enabled database I can find the latest change tracking version number by using

Select CHANGE_TRACKING_CURRENT_VERSION() As Latest ChangeTrackingID.

Which will give latest change tracking id (example 1022), Is there a way to find the datetime of this latest change tracking id.

View 3 Replies View Related

SQL Server 2014 :: Find Duplicate Rows Like Same Entries More Than One Time?

Sep 11, 2014

i have a table like below

create table staff_attendance
(
attendance_id int,
attendace_date datetime,
staff_id int,
working_year int,
hours int
)

values like

1 2014-06-30 00:00:00.0ST10121
2 2014-06-30 00:00:00.0ST10122
3 2014-06-30 00:00:00.0ST10122 ----same entry like previous one
4 2014-07-01 00:00:00.0ST10121
5 2014-07-01 00:00:00.0ST10122
6 2014-07-02 00:00:00.0ST10121
7 2014-07-02 00:00:00.0ST10122
8 2014-06-30 00:00:00.0ST10221
9 2014-06-30 00:00:00.0ST10222
10 2014-07-01 00:00:00.0ST1022 1
11 2014-07-01 00:00:00.0ST102 22
12 2014-07-02 00:00:00.0ST102 21
13 2014-07-02 00:00:00.0ST102 22

I Need to find the duplicate rows like same entries which is having more than 1 rows.... how do i find?

View 3 Replies View Related







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