I have a maintenance plan setup to expire backup sets after 4 days, but its keep backup copies for an infinite amount of time. I might be misunderstanding whats suppose to happen, but I would expect the files to be removed after 4 days.
backup database PPLicense to disk = 'D:License.bak'
I have run this 5 times. If I know run this command:
restore headeronly from disk = 'D:License.bak'
I can see 5 entries returned this all looks good. In SQL Management studio I try and restore this database by selecting the file. The Restore Database dialog only shows the last backup set position i.e. position 5 and now the 4 before it. Why is this not showing the 4 previous backups?
I am using SQL Server 2012 SP 2 (Version 11.0.3460).
Hi all,Suppose I have a SQL database table called Customer Info which contains six fields namely Customer ID, Address, First , Last Name , Password, and Time Remaining. The Time Remaining field contains the amount of time that a customer has before his or her password expires. I would like info in this field to be in hours and minutes and when it reaches zero, I would like the password to be deleted from the database. So I have two questions and please take into consideration that I am using dot net 2.0.1) Can this be done without having to write a custom function?2) If this can only be done by creating a custom function, how would I get the function to communicate with the database, in other words how would I let the function know that a customer's time is up? Any suggestions will be greatly appreciated, thank you in advance for your help.
How can you force a password, from a sql login, to expire?
I would like to use the password expiration feature for sql logins in SqlServer 2005. The msdn document provides example code for SqlClient SqlConnection.ChangePassword like in Bob Beauchemin's book. http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.changepassword.aspx
There is a modify_date in the system view sys.sql_logins but that is read-only.
My application is developed using VB6.0 and SQL Server 2000. Frequently the application displays error message, which says 'Timeout Expired - occurred while getting records" when no. of users grows more than 20. We are using processor based licence SQL Server. Under what are all the scenario, this error may come? Anybody explain me. Thanks in advance. K.Manoharan
This question is related to VSTS and above parameters in the request. Question is:
A script created with VSTS for testers has hard coded values for ReportSession and ControlID in the requests, These IDs are expired after some time and scripts fails to run after few hours. Can some one tell me how to set the session expiration time on these ID's in the Report server so I can increase the value to 60*24*365 (1 year) this would solve my problem with hard coded values in the scripts for above mentioned IDs.
I have a design question that I was hoping you all can help with.
When I normally design a table I always make sure to include a status field. This way I can "delete" a record without actually having to delete it, just update the record to a status which signifies deleted. This ensures my users have an undelete capability as well as safesguarding against the "mad clickers" which click right through the "You are deleting this record..." alerts.
I have been recently adding tables which have temporary records and are meant to expire at a certain date. I have designed these tables to have an expiration date field AND a status field.
My question is this: What is the normal convention relating to these types of records/tables? Should queries using these types of tables query them using the status AND the expiration date? Should you create a job that updates the records status based on the expiration date being passed. Should you use a view that only displays current records based on expiration date?
I just want to make sure Im following standard practice as I design these types of tables.
Is there a way to set up automated email notification beginning 14 days prior to when a SQL Server Login password (that has "Enforce password expiration" enabled) will expire?
I have a question regarding notification of password expirations.
Background: My workplace will soon be enforcing the password policy and password expiration facilities in SQL Server 2005. My understanding (and correct me if I am wrong) is that the period of validity for a password before expiration occurs comes from either active directory, or where there is no AD, the local machine security policy.
Because we are on a Novell network our SQL2K5 servers are all mixed authentication. For development purposes we are each given a separate account. Our applications, too, use sql accounts (not windows accounts) for database access. Having a development account expire unexpectedly is no problem; we'll change those passwords as they need to be. What I am concerned with is the accounts our applications use to access the database server; like most IT shops, our applications need to be available with interruptions in service as minimal as possible.
I would like to create and schedule a report to run every morning listing those accounts that are about to expire, or have expired, so that those passwords can be changed with little to no interruption in service.
Question: Where do I pull this data from? I couldn't find anything in the BOL, or online (so far), giving the details of how to determine when a particular account is nearing expiration, or has expired.
I would appreciate any advice anyone has to offer.
I'm getting this message on my third automated backup of the transaction logs of the day. Both databases are in full recovery mode, both successfully backed up at 01.00. The transaction logs backed up perfectly happily at 01:30 and 05:30, but failed at 09:30.
The only difference between 05:30 and 09:30's backups is that the log files were shrunk at 08:15 (the databases in question are the ones that sit under ILM2007, and keeping the log files small keeps the system running better).
Is it possible that shrinking the log files causes the database to think that there hasn't been a full database backup?
I'm new to MDX and was hoping someone could answer this question. I'm working on an MDX query, a simplified version is below.
What I'm trying to do is to pull 2 sets, based on a date range. Based on those, I'd like to see the total "cost" measure for each set, and divide one by another.
What I'm finding is that when I run the query below, the cost is broken out by month. So, my select statement gives me the cost for January 2008 and February 2008 in the CurrentPeriod set, and for January, February, etc. 2007 in the PriorPeriodData set. What I want instead is to get the total "cost" measure for all the months in each set. I believe this is what I'd get if I put the date range in a subcube or a where clause - but in that case, I wouldn't be working with 2 distinct sets.
Is there some other way to write this, or to combine all the months in the set before the measures?
PLEASE SEE my update (post #3) for a better simpler explanation!!!!!
Hi, I need a query which is basically
(query 1) Except (query 2)
SQL server supports (query 1)Union (query 2) but I can't get the Except to work.
Alternatively, I also tried to implement it by using the "NOT IN" but didnt work. Background: 3 tables, accnts, Opty, Opty_postn I want the accounts who have 1 or more opty's at 100% (sold) before 1/1/2002 but zero opty's at 100% after 12/31/2001. accnts has fields ID & name, ROW_ID opty has fields acct_id, prob, ROW_ID opty_postn has fields opty_id, close_dt
My query: SELECT accnt.name FROM accnt WHERE accnt.ROW_ID IN ( SELECT acct_id FROM opty where prob = 100 AND opty.ROW_ID IN (SELECT opty_id FROM opty_postn WHERE close_dt<1/1/2002) ) AND accnt.ROW_ID NOT IN ( SELECT acct_id FROM opty where prob = 100 AND opty.ROW_ID IN (SELECT opty_id FROM opty_postn WHERE close_dt >12/31/2001) ) AND accnt.ROW_ID = opty.accnt_ID
my intent was select account.names where id is in set(prob = 100 & sale before 1/1/02) but not in ( prob = 100 & sale after 21/31/01) SO ,the accounts which have sales both before and after get counted. But I want only those accoutns which have sales only before 1/1/02. I hope i explained this right. Thanks in advance for your help.
Hi,I've tried without success to create a function where one of theparameters determines the final line of a select statement.The final line includes a 'where referencenumber in (@set)' line.. and@set is the parameter I wish to use which is a string.If the set is just one value, it works fine, however with anything morethan that I just get no records returned.. If I output the parameter,and copy and paste that into query analyser I do get the correct result,so it's nothing to do with string delimiters etc..Any ideas to fix this problem? Or am I going to have to dynamic sql thewhole thing?Cheers,Chris
I need to manipulate some sets, doing joins based on intersection, and looking for subsets. Is there any way to store an array in a single data field? And then do operations based on those array lists? e.g. -
{1,2,3} intersect {2,3,4} ==> {2,4} (would like to then be able to do joins based on intersection, so that I could say, return all cases where two sets have all but one member from each in common...)
Hi, I'm currently trying to retrieve results from a large dataset, there are over 45000 records and I need to use them all to peform counts etc. I have set up views, but my page is still being returned slowly, is there anything I can do to speed this up? Thanks Gemma
I am trying to query one table and get two different timeperiods of data, I am summing monthly totals to provide a running year total, but I also need last month's total in a seperate column. This is what I have so far but the subquery makes me group it which provides duplicate grouping.DECLARE @LASTPD AS INT SET @LASTPD = (SELECT MAX(LASTPERIOD) FROM TABLE) SELECT NAME, POST_PD AS [MONTH],SUM(CHARGE_AMOUNT) AS MONTHLY_$, LASTMONTH.LAST_MONTH,(SELECT SUM(CHARGE_AMOUNT) AS LAST_MONTH FROM TABLE INNER JOIN TABLE2 ON TABLE2.NAME = TABLE.NAME WHERE POST_PD = @LASTPD AND TABLE2.NUM= 539 GROUP BY NAME) AS LASTMONTH INTO #TEMP_SAFROM TABLE INNER JOIN TABLE2 ON TABLE2.NAME = TABLE.NAME,(SELECT SUM(CHARGE_AMOUNT) AS LAST_MONTH FROM TABLEWHERE TABLE2.NUM = 539 GROUP BY NAME, POST_PDORDER BY NAME, POST_PD SELECT NAME, LAST_MONTH, CAST(SUM(MONTHLY_$)AS DECIMAL(20,2)) AS YEARLY_$ FROM #TEMP_SA GROUP BY NAME ORDER BY NAME
I need to upgrade a 6.5 box to 7.0 but also change the character sets. Let me know how this sounds.
-Have a 2nd machine w/ 6.5 on it and same char sets. -backup/restore data from prod box to 2nd machine. -upgrade 2nd machine to 7.0 using the same char sets. -uninstall prod machine and install 7.0 w/ new char set. -use dts to move data from 2nd machine to new machine. (changing char sets from old to new)
We're constructing a three-tier application. We want the middle tier to extract a recordset from the database, disconnect from the database, then pass the recordset to the front tier. After changes have been made by the front tier, it will pass the recordset back to the middle tier, which will reconnect, and update the database. The problem: Using stored procedures, the recordset is no longer available once the connection has been closed. Is there any way, using stored procedures, to be able to keep the recordset available after the connection has been closed, either by preserving it, copying it, or otherwise?
they are not necessary mutual exclusive. thus, union is not good. However, when I use derived table method, I will have 'dups' on column of 'Region' and 'county', 2 total are fine.
I have been tasked with creating a report that shows sales of our products grouped into buckets of 5 each, DESC. I have a table that has the itemNo and revenue. The final report would be something like:
Top 5 Spreads$695,066 Next 5 Spreads$467,845 Next 5 Spreads$416,946 Next 5 Spreads$361,946 Next 5 Spreads$305,607 Next 5 Spreads$270,567 Bottom Spreads$15,954
My initial thinking was to use row_number() and partition to label the rows in groups of 5 like:
i have these 2 queries with the included results sets...What commands could I use to take the TotalBlueCircle Column from the 2nd Results Set and have it included next to the TotalRugby column in the 1st results set??Do i need to do a UNION or use Sub Queries or something else?
I would like to match two sets of data. I have setup a view of data that contains a group of customers and their details. I want to view this data, but also find these customers in another table based on matching their surname and date of birth, then retreive the information stored on these customers from the second table.
Does anyone have any suggestions how i would go about doing this?
Thanks in advance Humate
quote:Originally posted by Michael Valentine Jones
It takes real skill to produce something good out of a giant mess.
I have the following situation. One set of data has 274 rows (set2)and anther has 264 (set1). Both data sets are similar in structure aswell as values for both of them were extracts from the same parenttable. Hope the info would substitute DDL. I need to find the "gap"rows between these two sets.Attempted to run a query likeselect count(*)from set2where not exists(select *from set1)did not yield what I desired. What else to try?TIA.
Hello!My client has a need to be able to store Japanese characters in theirPeopleSoft database. So we need to change the character set from fromLatin1_General (1252) to Japanese character set (932) on SQL Server2000 Enterprise. I have 2 questions:1) I would like to know if in SQL Server, the character set is machinespecific or is it defined at the database instance level?2) Can multiple installs of SQL Server co-exist on a single server withdifferent default character sets?ThanksVishal