How Can I Update CERTIFICATE Expiry Date ?

Aug 15, 2006

Hi,

I created a master key and

CREATE CERTIFICATE mycer
WITH SUBJECT = 'data encrypt',START_DATE = '12/1/2005',EXPIRY_DATE='7/9/2006'
GO

CREATE SYMMETRIC KEY mySymetric WITH ALGORITHM = TRIPLE_DES
ENCRYPTION BY CERTIFICATE mycer,password='mypass';
GO



and i created a table with varbinary field and i added 2 encrypted records and i got it properly

i need to update the expiry data for my certificate , so i dropped the symetric key and their certificate and run the following

CREATE CERTIFICATE mycer
WITH SUBJECT = 'data encrypt',START_DATE = '12/1/2005',EXPIRY_DATE='12/12/2006'
GO

CREATE SYMMETRIC KEY mySymetric WITH ALGORITHM = TRIPLE_DES
ENCRYPTION BY CERTIFICATE mycer,password='mypass';
GO

i tried to get the added record , i got a null value somthing is happened while dropping the key for the encrypted data??

any help ?

Jim

View 5 Replies


ADVERTISEMENT

Update Status Field After Expiry Date

Mar 26, 2007

Consider the following tableCustomercustId char(10)accountExpiryDate datetimeaccountStatus bitNow, I want to update the accountStatus to False as soon as thecurrent date becomes accountExpiryDate.I think it can be done using "SQL Agent" but my webhost doesnt provideme access to that. I have access only to the Query Analyzer.ThanksShane

View 12 Replies View Related

How To Calculate Expiry Date Using Stored Procedure

Oct 16, 2004

Hi, i'm trying to calculate on the expiry date for product which include the start date and end date.

the product can't b displayed if the start date haven't reached the date, besides, it oso can't b displayed if it has expired.

the storedprocedure tat i've written is:

WHERE
DateDiff(day, StartDate, getDate())<=0
AND
DateDiff(day, EndDate, getDate())>=0

i wonder why it can's show the result!!! is the code correct?

View 3 Replies View Related

Expiry Date Auto Change Field

Feb 2, 2008

Hi,

My table has more columns than this but I will just use the ones here tht are important.
I have two columns in a table these are "ExpiryDate" and "Archived".
When the row is created the "Archived" field will be null but the user will have entered a expiry date. When this date is reached I would like the "Archived" data to change to "1". Is this possible? Would I have to do it through some kind of script or can I set the database to do this automatically?

Thank you, Mark

View 3 Replies View Related

SQL 2012 :: Disable Logins Automatically Depending Upon Expiry Date In A Table?

Jun 4, 2014

Disable logins on access expiry date(Not windows password expiry). we grant access to users on databases only for 60 days. So access is only valid for 60 days. Then the user should again request access to the database going thru security clearance. Thn the DBA's enable the login. Maintaining all these logins of users manually is causing more confusion.
As we know, we dont have any inbuilt functionality to automatically disable logins in SQL Server.

I have a table where the logins and expirydate were recorded in a DB.

Using this table and SQL Server agent. Can i achieve this process automated ?
CREATE TABLE [dbo].[LoginsExpiry](
[LoginName] [varchar](50) NULL,
[ExpiryDate] [date] NULL,
[Roles] [varchar](500)
) ON [PRIMARY]
GO

View 3 Replies View Related

Certificate Start Date Is Tomorrow - How To Make It Today?

Aug 16, 2006

Hi,

I use MS certificate server to request/make server certs but the "not before", or start date is tomorrow for a 1 year cert. I dont care how long but I want the cert to start immediately (today).

Regards,

Simon.

View 7 Replies View Related

Certificate Loading Issue - When Creating Certificate From SQL Server To SQL Server Express On The Same Machine

Jun 29, 2007

Hi, We are trying to implement Service Broker between SQL Server Express and SQL Server on the Same machine and we are having problems with certificates. We are creating a certificate on SQL Server, backing up the certificate on a file system and then loading certificate on the SQL Server Express from the file and we are keep getting the following error: Msg 15208, Level 16, State 1, Line 1 The certificate, asymmetric key, or private key file does not exist or has invalid format.



Following script runs fine on SQL Server.




Code Snippet

use master



Create Master Key Encryption BY Password = '45Gme*3^&fwu';

BACKUP MASTER KEY TO FILE = 'C:ServiceBrokerPrivateKeyMasterB.pvk'

ENCRYPTION BY PASSWORD = '45Gme*3^&fwu'

Create Certificate EndPointCertificateC

WITH Subject = 'C.Server.Local',

START_DATE = '06/01/2006',

EXPIRY_DATE = '01/01/2008'

ACTIVE FOR BEGIN_DIALOG = ON;

BACKUP CERTIFICATE EndPointCertificateC

TO FILE = 'C:ServiceBrokerEndPointCertificateC.cer'



Following script runs on SQL Server Express:






Code Snippet

Create Certificate EndPointCertificateC

From FILE = 'C:ServiceBrokerEndPointCertificateC.cer'

WITH PRIVATE KEY (

FILE = 'C:ServiceBrokerPrivateKeyMasterB.pvk',

DECRYPTION BY PASSWORD = '45Gme*3^&fwu'

);





If we run the script other way around, it works fine. If we use the SQL Server on some other machine, the script works fine. But only on the same machine, it throws this error. We made sure the permissions and everything. Let us know if there is any work around or what are we doing wrong.



Any help is appreciated. Thank you,

View 4 Replies View Related

Automatic Content Expiry

Jun 21, 2007

Hi All,I have a job coming up which involves me creating a  vacancy system for our website.I (think) I'll only need one table:ID (PK)JobTitleJobLocationSalaryHoursJobDescriptionValidFrom (Date/Time)ValidTo (Date/Time)I'll display this data using a C#.Net repeater but I was wondering how I can automatically strip the page of the jobs that have gone past their expiry date? Is is straightforward to achieve?Thanks in advance,Brett 

View 2 Replies View Related

EncryptByCert Expiry Dates

Nov 18, 2005

SQL Server 2005 allows to use the EncryptByCert function to encrypt a Column, for example in an Instead-of Insert Trigger, and to use a DecryptByCert function to decrypt a Column, for example in a View.

This is indeed good news, but I have a simple :confused: question. To create a Certificate using the CREATE CERTIFICATE you have to give an EXPIRY DATE, or it will default to an expriry date of 1 year. How can one read the encrypted Column after the certificate has expired ?

Is there a way to renew a certificate without having to first decrypt all the fields and export them ?

View 3 Replies View Related

Transact SQL :: Get Expiry Dates From CC

Sep 18, 2015

I have a Column CCExp Varchar(7)  that stores data like below

NULL
'01/15'
'02/15'
'03/15'
'04/15'
'05/15'

[Code] ...

I am trying to get all expired cards which means, I am trying to get all cards which are behind sept 2015..like when I query I would like to get 8/15 and so on expired cards I am able to get the year , but with the below query I am getting all months less then 9 but i am missing 10,11,12 months cards values also I am having Conversion failed when converting the varchar value '#N' to data type int.

SELECT  CustomerBillingInfoID ,
        CCExp
FROM    CustomerBillingInfo
WHERE   LEFT( CCExp, 2) < MONTH(GETDATE())
        AND RIGHT( CCExp, 2) <= RIGHT(YEAR(GETDATE()), 2)
and CCExp NOT LIKE  '#%'
and CCExp not like 'NULL'

View 8 Replies View Related

Help Backups - RETAINDAYS / Expiry Period

Dec 20, 2005

RETAINDAYS option in BACKUP command.
SqlServer2000 (standard) on Win xp server.
Old backups are not being removed from backup sets.

I've created logical dumpdevices which maps to a physical file on disk - using sp_adddumpdevice. Regular, scheduled backups are successfully written to the backup sets (Complete, differential & Tlog) - This works fine and I can restore from them OK.
I've set the RETAINDAYS option of BACKUP command to keep backups for varying periods (eg full = 8 days, diff = 2 days, and Tlog = 1 day).
When the backups are viewed by 'drilling down' thru >Backup > open backupdevice > view contents.... all previous backups are still available even though their expiry date has passed.
The backup set files (dumpdevice files) are getting inexorably bigger and will eventually fill the available disks !
I don't want to delete or overwrite the entire contents of the backup set - just those backups more than 8 days old.

I've run sp_configure 'media_retention' 1 RECONFIGURE WITH OVERRIDE

but the old backups are still there.

dbs are getting ever bigger (high activity OLTP system) currently 2 production dbs totaling 50 GB.
Is this a bug? - ie. the option to set a retention period even though I'm writing to a logical 'dump device' rather than a normal *.BAK / *.TRN file?
or Am I doing something wrong?

HELP.

Cris Yarker
email to crispin@paymentsystemsltd.com

View 3 Replies View Related

Server Load And Timeout Expiry

Feb 24, 2004

Hi all,

The company that I work for has an internet application that has been running in our client's environment for 2 years.

The SQL box is a quad Xeon 750 with 4 gig of ram and over 50gig of disk. This box has 4 databases that are used for the application. The primary database is about 1.5gig in size (.mdf file) the others are relatively small.

The box is queried from a separate windows 2000 server box with our COM based application running under IIS.

The boxes are located on the same switched LAN.

Up until recently the application has been running fine, but all of a sudden we have had masses of database time outs and the processor utilisation is always 80-100. In turn these time outs crash IIS eventually.

I Understand all of the ideas about increasing the timeout in a command object, etc.

I have monitored blocking on the SQL server and over a 30 minute period of live usage I saw 1 block and 0 deadlocks.

In addition to the above often our application gets an imediate time out error, hence after no time.

We have also monitored the network bandwidth between the two boxes and they only use about 30% on average of available bandwidth.

My 1st question is - Does SQL give a time out error (hence refuses connections) if it is running at 100% and cannot handle any more load??

My 2nd question is, In other peoples experience is the box we are using powerful enough.

My 3rd question is, Can the network have an effect on the time outs even though there is plenty of bandwidth.

Thank you in advance for your time in reading this and I appreciate any input that you may have.

Simon Gratton
Senior/Lead Developer
Fastrack Software Ltd.

View 2 Replies View Related

Password Expiry With HTTPS Merge Replication

Feb 13, 2006

Hi

We are using anonymous HTTPS merge replication.


The windows password used for the client subscriber expired on the publisher.

I reset it on the publisher - but SQL still seems to think that it is not expired - I get the following message in the event log of the publisher running SQL Server 2005

Login failed for user 'XYZ'. Reason: The password of the account has expired. [CLIENT: <local machine>]

 

Any ideas ?

thanks
Bruce

View 1 Replies View Related

SQL Server 2012 :: How To Match Two Different Date Columns In Same Table And Update Third Date Column

May 30, 2015

I want to compare two columns in the same table called start date and end date for one clientId.if clientId is having continuous refenceid and sartdate and enddate of reference that I don't need any caseopendate but if clientID has new reference id and it's start date is not continuous to its previous reference id then I need to set that start date as caseopendate.

I have table containing 5 columns.

caseid
referenceid
startdate
enddate
caseopendate

[code]...

View 4 Replies View Related

SQLS7&&VB6 Date Update Gives Syntax (Not Date Format) Error In Stored Procedure

Jul 20, 2005

Hi,I have a problem with updating a datetime column,When I try to change the Column from VB I get "Incorrect syntax near'942'" returned from [Microsoft][ODBC SQL Server Driver][SQL Server]'942' is the unique key column valueHowever if I update any other column the syntax is fineThe same blanket update query makes the changes no matter what isupdatedThe problem only happens when I set a unique key on the date field inquestionKey is a composite of an ID, and 2 date fieldsIf I allow duplicates in the index it all works perfectlyI am trying to trap 'Duplicate value in index' (which is working onother non-date columns in other tables)This is driving me nutsAny help would be appreciated

View 5 Replies View Related

Seperate Date And Time Merge; Done At SQL Update Or C# .NET Then Update

Feb 18, 2006

I do realize that his could be posted in a few spots but I think the answer is in the SQL.
I have a ASP.NET page, with a SqlDataSource, Text Box and Calendar Controls. I have the textbox and calendar controls eval'ed to the same sql data source DateTime Field. The text box is formatted eval to small time and the calendars eval has no formatting.
ex:
<asp:TextBox ID="START_TIME" Text='<%# Eval("EVENT_START","{0:t}") %>' runat=server Width=200></asp:TextBox>
I want to merge the two controls; one has the date the other has the time when I update the pages data to the SqlDataSource field EVENT_START. I've tried a couple of methods, but I would like some other opinions. As Sql server only supports date and time together I am storing the two together.
I could merge the two together in the code behind on the update button's event handler or merge the two during the update query using parameters.
Not that I could get an illegal date for the calendar control, but I could get garbage from the textfield time. So I still would have to do validation on the text field before the SQL server could do the update.
There's a few ways to go about this, so I was wondering if anyone else has figured out an elegant way to handle it.
wbochar

View 1 Replies View Related

Default Date(current Date) Function W/ Update?

Mar 10, 2008

I have a reference table that currently has no web front-end. It's a small table(<10 rows) that's not going to change very often (maybe once every few months).

We manually update rows on the table via the GUI table interface in Enterprise Mgr., not in T-SQL.

What I'd like to do is have SQL Server automatically update the "Last_Modified" column with the current timestamp. I can do it on an Insert using the GetDate() function, but if I update a row, this doesn't work.

Is there a function I can use that can auto-populate for both insert and updates?

View 4 Replies View Related

Update By Date Help Please

Mar 6, 2005

Here is the code...
How do I get the table just to give me back the date by latest date??

update RIO.dbo.tblArCust
SET CustName = LEFT (CustomerName,25),
Addr1 = LEFT (Address1,25),
Addr2 = LEFT (Address2,25),
City = LEFT (COFFEE.dbo.vueCustomerAddress.City,15),
Region = LEFT (State,2),
PostalCode = LEFT (Zip,5)
from COFFEE.dbo.vueCustomerAddress
join RIO.dbo.tblArCust
on COFFEE.dbo.vueCustomerAddress.CustomerCode = RIO.dbo.tblArCust.CustId
AND COFFEE.dbo.vueCustomerAddress.addresstypeid = 1 and COFFEE.dbo.vueCustomerAddress.LastUpdatedDate > ????

Any help would be great.

View 2 Replies View Related

Update Date

Sep 7, 2006

I'm trying to Update a Date in my database, but keep getting a Syntax error, and I can't find the problem. Here's the code;

<%
sStatus=Replace(Request.Form("sStatus"),"'","''")
dChangeDate=Replace(Request.Form("dChangeDate"),"'","''")
nID=Replace(Request.Form("nID"),"'","''")

set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & server.mappath("../database/COAKLEY_ACCESS97.mdb")
sSQL = "Update tblCoakleyNew Set sStatus = '" & sStatus & "', dChangeDate = #" & dChangeDate & "# " & "Where nID = " & nID & " "

oConn.Open
oConn.Execute(sSQL)
oConn.Close
Set oConn=Nothing%>


Harold

View 2 Replies View Related

How To Update Date Using Where .....

Jul 18, 2007

I have two tables incidents and prodwin .
I have prodrecddt (datetimecolumn) in prodwin table which I have to update and it should be updated such that it should be greater than initdt and less than invcompleteddt which are in incidents table.
Right now my prodrecddt is same as initdt.
My date diff between initdt and invcompleteddt is from 3- 28 days

I thought of increasing the prodrecdt plus one and then updating it like this but it wont work this way

UPDATE prodwin
SET prodrecddt = invcompleteddt -DATEPART(hour, invcompleteddt)%5 + 1

is there any way i can use WHERE field so that i can say where datediff is more than 5

Thanks a lot in advance

View 1 Replies View Related

Last Update Date For SCD

Mar 12, 2007

hi,

i have a column that stores the last update date for a dimension table. This column will store the date when a row was last updated.

i'm using SCD in my dimension table data flow. i can't manage to set the lastupdate column to be modified when a row has been changed. when i set the column as fixed attribute, the column will not change even though it has been updated. if i set the column as changing attribute, the whole column for the table will change regardless it has been updated or not...

any idea?

View 10 Replies View Related

Last Update Date For A Table??

May 30, 2002

Is there a way to find when was a table last updated? We do not have any timestamp column in it. Idea is to get rid of tables that are not used for long long time! Thanks.
Di.

View 1 Replies View Related

Update Date In Mssql

Sep 28, 2005

hi.
i am working with PHP and MSSQL (i know its not a smart move, but I don't have a choice).
I got almost everything working correctly except the date format.

I can select the date and display it the way I want by doing this select convert(VARCHAR(10), date, 105) as new_date FROM table.

But when I have a field to update the date I am having trouble.

How do I update the MSSQL database with a new date if the date displayed is DD-MM-YY

View 2 Replies View Related

Record Update Date

Nov 2, 2005

How to update the Last Update Date of a modified record? I want to put this in table trigger .

Or any setting can be used?

Please help~~~~

View 20 Replies View Related

How To Update A Date With Dd/mm/yyyy Format

Jan 28, 2008

How do I update a date with this format?  I put HTMLEncode = false and dataformatString = {0:d} so I can just have the date and drop the time.  Now it's not updating in the database.
Here's my stored procedure:
CREATE PROCEDURE [UpdateRtnDate]  @loanrequestid int, @returndate datetime  AS Update LibraryRequest
set[returndate]=@returndatewhere loanrequestid = @loanrequestid 
It doesn't go into the database what am I misisng?

View 4 Replies View Related

Max Date In Linking 2 Tables For Update

May 27, 2003

I have a table called ppd2002, which has an id field a testdate field (datetime), and a previoustesdate field (datetime). The testdate field is filled in. I have another table called ppd which has an id field and a testdate field. I need to update the ppd2002 field called previoustestdate with the max(testdate) field from ppd, but that max date must be less than the current testdate in the ppd2002 field. The id field is the link field between the 2 tables. Tried to create a view, then a update but still stuck.

View 2 Replies View Related

Update Rows With Increment Date

Apr 5, 2014

I have a table with 4 fields,

Startdate, rec_num , recursive_value, recursive_date
04/02/2014 3 d 04/02/2014
04/02/2014 3 d 04/02/2014
04/02/2014 3 d 04/02/2014

I will like to update recursive_date to emulate the recursive_number and recursive_value fields which specify every 3 days. The recursive_value field can also be w to specify weeks, m to specify month or y to specify years.
So my value in the recursive_date field should be updated as followed

Startdate, rec_number , recursive_value, recursive_date
04/02/2014 3 d 04/02/2014
04/02/2014 3 d 04/05/2014
04/02/2014 3 d 04/08/2014

View 19 Replies View Related

How To Update Current Date And Time Into DB

Mar 16, 2015

I am new to SQL and want to understand how to update current date and time into DB2 in SQL.

View 1 Replies View Related

Update Table Date/time

Mar 15, 2006

hi! i'm new to sql and working on my first database, I use microsoft sql server 2000 - in my table i want a row in which date and time is saved whenever the dataset is changed. I use getdate() as default value and it saves the time when I create a new entry, but not yet when I update an old one. I know that it must be a formula with something like update tbl set = getdate() but I don't know exactly how it works. any help on this?

View 7 Replies View Related

Update Table On Date And Other Condetion

Jan 15, 2007

I have a table with date,cost,Ltype columns
I have to update the cost based on Ltype and count of rows in a singel day.
the business rule is like this
1.LtypeA =$90 LtypeB=$30
2.50% discount($45 & $15) after 30th row in a singel day for each row over 30

i have data for 2006 year and updated every day with new rows ie
i have to run a update for the historic data and run it everyday for the newonce.

any help appriciated

View 5 Replies View Related

How To Update A Field Defined By The Date Or.....

Mar 9, 2007

I have a site and there is a ` current features` on the index which shows our newest pictures for movies. I use dreamweaver, so When you insert record a "picture", it takes place on the table, but when you insert another one, it doesn't replace the current one.

View 1 Replies View Related

Date Update Based On Another Table

Jul 9, 2007

I have to update dates column based on other table

1)MFGDt date which is a column in PRODWIN table should be before awaredt(say between 1 to 3 months)
which is in table incidents

2)Expirydt date from prodwin table should be after awaredt (incidents table)(say between 2 or 3 months)


UPDATE prodwin
SET expirydt =awaredt + DATEPART(hour, invcompleteddt)%5 + 1

It is giving me this error because not in the same table "Invalid column name"



3)prodrecddt should be after AWAREDT and before Invcomleteddt (incidents table)

View 8 Replies View Related

UPDATE Only Records That Were Created After A Date

Sep 5, 2007

I have a text file that I am importing into my database.

Within this textfile there is a field named "Order_Date". Date Format is like this: 20070905

I want to run this DTS once a day, updating only the records that were created on "today's" date.

For example something like this:

UPDATE NAME
WHERE Order_Date = ????? (I want a variable that is todays date in 20070905 format)

View 7 Replies View Related







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