How To Determine Last LSN For Database
Feb 13, 2008
What is the most reliable way to determine the last LSN of a database? I've looked in sys.database_files to no avail. I've also looked in msdb.dbo.backupset which is accurate but only based on backups already performed not the current state of the database.
-joe
View 5 Replies
ADVERTISEMENT
Feb 21, 2001
Problem: I can add 4 items to a SQL 7.0 database but I need to redirect the user if all 4 items exist in the same Record elsewhere in the Database.
Clearly I need some kind of statement like "if category1 = var1 AND category2 = var 2 AND..." but don't know where to put it.
Code:
strSQL = "SELECT * FROM tblUserQuarter"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn,adOpenStatic , adLockOptimistic
'Insert choices from report.asp into tblUserQuarter
objRS.AddNew
objRS("cboFY") = Request.Form("cboFY")
objRS("Quarter") = Request.Form("Quarter")
objRS("ID") = Request.Form("ID")
objRS("Report") = Request.Form("Report")
objRS.Update
objRS.Close
Set objRS = Nothing
objConn.Close
set objConn = Nothing
View 1 Replies
View Related
Feb 25, 2015
I ran a query to see how big my database on my SQL Server is and do not understand the metrics. I want to see how much of my 10GB database is left.
database_namedatabase_sizeunallocated space
ANTHEMQ 6521.06 MB243.55 MB
reserveddata index_sizeunused
1332304 KB1328168 KB1800 KB 2336 KB
View 3 Replies
View Related
Mar 8, 2007
Simple question...
When I use the full version of SQL Management Studio, I can run a report to view the size. How can I do this with SQL Mgmnt Express?
View 1 Replies
View Related
Jun 15, 2006
Hi There
I am trying to establish the date a database was last used.
At first i checked out sp_helpfile and sysfiles to see if there was a date last modified, i also tried using xp_cmdshell to check the date on the actual .mdf or .ldf on the o/s but if the file has not grown the date will be the create date.
I need to establish the date a database was last used, either the last time someone logged into it or the last time any sort of command was run against the database, i cannot use sysprocesses as there are no connections to the database, so i need to determine the last time there actually were any processes run against this database.
And i need to use tsql, checking audit logs etc is not viable, can anyone help ?
Thanx
View 6 Replies
View Related
Dec 18, 2007
Does anybody know of a way to determine the last date/time a table has been accessed (query/update)? I've done enough research to know that this isn't easy. However, perhaps somebody has figured out a way through some of the stats that SQL Server keeps to determine the last access of a table. I have recently been put on a team that had no DBA and has a number of databases out there. They would like to determine which databases are inactive and get rid of them. I am a developer and haven't had much SQL Server Administration experience. Any info will help greatly! Thanks!
View 2 Replies
View Related
Sep 17, 2015
I am working on Sql Server 2012. and I have multiple databases there. Out of those, i want to move one of my databases to other SQL server 2012, For that i was trying to get approximate size of my database on current server. As i don't have the admin rights, so i can't get that. Can i get the approximate size by right clicking on database and by using the size property Under Database category to get the size idea?
View 4 Replies
View Related
Dec 31, 2007
I have a SQL database that gets populated by another program. Is there a way to determine when a new record is added to that database?
Thanks
View 4 Replies
View Related
Aug 23, 2007
When executing a stored procedure that is defined in another database, as:
USE db1;
EXEC db2.dbo.sproc;
Is there a way in the stored procedure "sproc" to determine that the caller made the call from db1?
View 1 Replies
View Related
May 14, 2015
Is it possible to determine the data flow within a database? e.g. I start by adding/inserting a record in MainTable1, then through a trigger SubTable1, SubTable2 have records inserted into, SubTable3 has a record updated into, then a StoredProcedure1 is run which updates first SubTable4, then a StoredProcedure2 is run which adds a record in SubTable5. So by simply adding a record in MainTable1, I affect 5 other tables.
Imagine a more complex process than this one now (which I'm currently facing and I want to win time and precision; I will still investigate it myself (if I will find an answer first - I will post it here)) Is there a way I could "extract" this flow by using T-SQL?
View 7 Replies
View Related
Feb 1, 2007
Hi All,I have to a few backups restored from a set of backup files. Thebackup files have been removed from the drive because of some storageconstrains...For some data comparison reasons, I need to figure out the actual dateof these backup files that is used to restore these databases. Isthere any system table I can query to figure the actual backup timesof these databases...Any help will be much appreciated.. Thanks in advance.- Aravin
View 1 Replies
View Related
Jun 14, 2007
My compatibility settings are fine. Anyone know how to to this?
View 4 Replies
View Related
Jul 31, 2015
I was asked to determine the last time 2 databases were accessed.
Are the .trc files an accurate way to determine the database access history?
View 5 Replies
View Related
May 28, 2015
I use a number of certificates on my database server. I'm trying to verify the correct certificate is being used on the correct database.
View 3 Replies
View Related
Nov 15, 2007
Hi there,
Does anyone know a way (a query perhaps?) to determine which logins have write permissions to a specific database on SQL Server 2005? Ive thought about joining sys.syslogins & sys.sysusers but looking at the columns, not sure which one would render me that info.
Any help is appreciated. Many thanks!
View 1 Replies
View Related
Jun 25, 2007
Hi, all experts here,
Thank you very much for your kind attention.
Just found that my tempdb is always full whenever I run a query against a large database. Could please any experts here give me any advices on what is tempdb database used for and how to determine what files can be deleted from it?
I am looking forward to hearing from you and thanks a lot in advance.
With best regards,
Yours sincerely,
View 3 Replies
View Related
Apr 22, 2015
I was wondering if there was another method to determine when a database was last backed up without using the backup history tables in msdb? whether using DBCC DBINFO, DBCC PAGE on a specific database page...etc.
Also, when restoring a database, is there a trace flag you can use to force restore details to be written to the error log?
View 4 Replies
View Related
Oct 6, 2015
How do I determine the read/write frequency on a database table? I am trying to do this on a 2012 and 2008 R2 servers.
View 2 Replies
View Related
Mar 25, 2008
I need to determine the following about the current authenticated Windows domain user who is trying to access a SQL Server via a trusted connection.
1 Has the current user been granted login access to the trusted SQL Server?
2 Has the current user been granted access to a specific database?
3 Is the current user a member of a specific database role such as (DB_ROLE_ADMINISTRATORS)?
Thanks,
Sean
View 6 Replies
View Related
May 22, 2008
Hi,
Please give the T-SQL script for this ? Thanks
Shanth
View 4 Replies
View Related
Jan 22, 2008
Hi all,
How to determine the value for the bar in Neural Network Viewer? I know the value is displaying in the tooltips when we pointing to the bar in the table but i don't know how to get them. So where can i get those of calculation or data of score, probability of value1 and 2, and lift for value1 and 2 ? Is it get from the Microsoft Neural Network Content Viewer? which column and how to calculate? If not, please advise.
Hope my question is clear.
I am looking forward to hearing from you shortly and thanks a lot in advance.
Thanks!
With best regards,
Yours sincerely,
xuenly
View 8 Replies
View Related
Sep 21, 2006
I am trying to determine the next available order id using the method below. It works provided the table has a record in it. If it doesn't I get the error "Input string was not in a correct format." I am certain that it is because the query is returning a value of NULL. How can get around that or check for the NULL value?' Establish data connection...Dim sqlConn As New SqlConnection(ConfigurationSettings.AppSettings("connectionstring"))'Determine order id number...Dim order_id As IntegerDim strSQL As StringstrSQL = "Select MAX(order_id) from mkt_order"Dim sqlCmd As New SqlCommand(strSQL, sqlConn)Dim sqlDA As New SqlDataAdapter(sqlCmd)Dim sqlDS As New DataSetsqlDA.Fill(sqlDS, "item")If sqlDS.Tables(0).Rows.Count <> 0 Thenorder_id = Convert.ToInt32(sqlDS.Tables(0).Rows(0)(0).ToString()) + 1Elseorder_id = 1End If
View 1 Replies
View Related
Aug 3, 1999
Good day,
We have a web application (ASP) running on SQL Server 7.0.
Recently, the users are getting quite a lot of timeouts on
the database:
Microsoft OLE DB Provider for ODBC Drivers error '80040e31'
[Microsoft][ODBC SQL Server Driver]Timeout expired
The database is not supposed to be doing too much work, so I can't
understand why these timeouts are occuring. How can I determine
the cause of the timeouts?
The cause could probably anything from a trigger that's taking
too long, a query that's taking too long, or simply bad database design.
I've looked at SQL Server's Profiler, but could not yet use it
successfully to give me any hints of what could cause the timeouts.
Any ideas of how I can use Profiler, Performance Monitor, or any other
tool(s) to see what is happening in the background in the database,
i.e. how much processing a trigger is using, etc.
Thanks very much!
---
Gert Lombard
OSI Airport Systems
South Africa
View 1 Replies
View Related
Dec 28, 2006
I'm new to full text catalogs and we have a vendor who's code utilizes them. The database server is SQL 2005 and I am noticing the following message in the SQL log every minute.
Changing the status to MERGE for full-text catalog "ResearchCatalog" (5) in database "DBA_Test" (11). This is an informational message only. No user action is required.
A SQL job is running the following command every minute.
exec sp_fulltext_catalog 'ResearchCatalog', 'start_incremental'
What is the typical frequency for running an incremental?
Can the messages be suppressed?
Thanks, Dave
View 3 Replies
View Related
Jul 23, 2005
for sql servers how can i determine who [what accounts] are the dbas?
View 1 Replies
View Related
Jul 20, 2005
I've been doing a lot of reading on this and my head is starting tohurt! It seems to be quite a feat to work out how much memory isactually being used by our server.I'm running W2K advanced server with SQL 2000 EE, 8GB of RAM, a min of4GB and a max of 6GB is assigned to SQL server.I'm trying to work out whether we've assigned enough or toomuch/little memory to SQL server. My first thought was to let SQLdymanically manage its own memory and see how much it uses, of coursewhen AWE (/3GB /PAE) is enabled it will just use all that isavailable.In perfmon "target server memory" = 6.1GB, "total server memory" =6.1GB, "total pages" = 768000 ( x 8KB = 6.1GB).My second thought was to use "total pages" - the average "free pages"= average mem used, therefore giving me the average amount of memoryused by SQL. I found out that SQL uses a min of 4GB (the min weassigned) and the max of all the memory, 6GB.Is there an easier way of finding out how much memory is actually usedin this situation or is going by the above average the best way?What i'm unsure about is will SQL just use all memory assigned to ituntil it has the whole DB in memory? 20GB including indexes etc....Any help would be greatly apprechiated.
View 2 Replies
View Related
Dec 1, 2006
I need to determine when (maybe) and if (definitely) a SQL Agent job will run again. I need to maintain a table of the next pending execution for each job. I need to be able to update this table from within a SQL Agent job, but preferably from within an executing SSIS package in the job. Is this possible and if so, any suggestions on how?
Thanks
View 3 Replies
View Related
May 3, 2008
Hi all... This is the definition on the M/S site:
"Deterministic functions always return the same result any time they are called with a specific set of input values and given the same state of the database. Nondeterministic functions may return different results each time they are called with a specific set of input values even if the database state that they access remains the same."
Good... straight forward, right? Ok.... try entering thses command seperately:
Create Table Readings (ReadingDate DateTime Not Null);
Create Function [dbo].[funct_SameDate](@datReadingDate Datetime)
Returns DateTime
As
Begin
return @datReadingDate;
End
Alter table Readings add
[TempColumn] as (dbo.[funct_SameDate](ReadingDate)) PERSISTED NOT NULL;
Error on last command returns:
Computed column 'TempColumn' in table 'Readings' cannot be persisted because the column is non-deterministic.
Can someone please explain this to me? The same value is always being returned.
This does work:
Create Table Readings (ReadingDate DateTime Not Null);
Alter table Readings add [TempColumn] as (ReadingDate) PERSISTED NOT NULL;
I obviously want to do more things inside the function, but I can't get by the first step.
Any suggestions?
Thanks!
Forch
View 6 Replies
View Related
Dec 27, 2007
Hi,
I have a report that has a table with detail grouping. This table shows the sales by day for each product. The users only want to see the date field for the first item in the group. After that, they do not want to display this field (to reduce the data on the report). However, when the data wraps to a second page, they want the date to appear on the first row of the new page.
Is there any way to determine if a row is the first row on a page?
I tried using the RowCount, but that continues from the previous page.
Any thoughts?
Thanks!
David.
View 8 Replies
View Related
Jun 18, 2007
hi,
since I am kind o'new with SQL, I preffer get an advice fro you pro's: I created an application which performs access to a database on an SQL server. the application will be used by a few different users, each on a different computer. the application calls stored procedures, updatesinserts records in tables on the SQL and delete rows. what would be the best role to define the users activity ? How do I limit their activity ONLY to the specified actions ?
View 1 Replies
View Related
May 17, 2007
I'm working on a sproc that determines the next order id for a specified customer. The table has
custid int,
ordernum varchar(10)
Data is:
1000, 1000-001
1000, 1000-002
1001, 1001-001
1000, 1000-003
I need to know the next ordernum for the specified custid. For example, GetNextOrderNum(1000) should return 1000-004. GetNextOrderNum(1002) should return 1002-001 (since there aren't any orders yet).
I honestly don't know where to begin.
Can someone please help?
View 6 Replies
View Related
Jun 6, 2007
Hi All,
i am working with database mirroring and i need to be able to determine which database will be principal.
for example if server A is principle and server B is mirrored and server A is down, then server B take owner and become principle, after fixing server A i want it to be principle again,
is it possible ??
View 4 Replies
View Related
Dec 11, 2006
With an INSERT statement I add a record to a table.
Then I want to get the (autonumber) ID of the newly created record.
What is the fastest and best way to do this?
View 7 Replies
View Related