Simple Date A DB Was Created On The Server

Apr 13, 2008



Well you would think it was pretty simple. If I create a Database on Server a last week, take a backup of that database and put it on server b today, the CRDate in sysdatabases still shows the date of last week instead of today. I need to find the actual date for all 150+ servers from sql 7 - sql 2005 in our domain. Any ideas? I had heard that maybe SQL DMO had an object that might be helpfull but I have not been able to look it up anywhere or see how to use it using sp_oa procs.

Any help would be greatly appreciated.

View 3 Replies


ADVERTISEMENT

Table , Column Created, Modified Date In Sql Server 2000 Or 2005

Oct 10, 2007



Hi

Any one please tell me is there any possible way to identify the table modified date.

I have checked the table created date from sysobjects or by right click properties. my requirement is to identify the exact date of table modification and column creation,alter dates.
Is there any such provision in sql server 2000 or 2005 , My application is in sql server 2000.

I need to confirm this because some database structure modification has affected my application and causing dataloss i need to check with the date of structural change of table and lost data date
can any one help

View 8 Replies View Related

SQL Server 2008 :: Find Date Created And Modified Values Of All Files In A Location

Jun 11, 2015

Script to find the details of creation date and modified date of all files located in a path?

I wanna write few custom messages before I delete some files from a path.

View 9 Replies View Related

Date Created Defualt Value

Jul 1, 2007

 in my database i have a "datecreated" feild, its datatype is "datetime", is it possible to set the defualt value as the time now? if so what do I put in the defualt value property? thanks a million si!

View 2 Replies View Related

Get Created Date From A File

Apr 3, 2008

Hi Guys,
Im new using SSIS and i just created a data flow that reads from multiple flat files (with a mutipleflatfiles conn manager) and inserts the files data to an sql server (with an ole db destination)

The thing is i need to insert the created date property of each file im importing and i dont know how to do this.

I've read i could do this with a script but im not very familiar to it.

Could someone help me there?

View 2 Replies View Related

Index Created Date

Dec 10, 2007



Hi All,

Is there anyway to get the date an index was created on a table? I can see that there is a created date column on various system tables (sys.objects etc) but I can't find one related to an index.

Thanks

Rich

View 3 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

Date Parameter Issue When Created From Query

Aug 27, 2007

I have a date parameter for a report that is intended to search 'within the last X week/month...'. The SQL for this is basically WHERE [datefield] >= @dateparam AND [datefield] <= GETDATE().

The @dateparam is defined in the report as 'From query', the value field is 'thedate', and the label field is 'thetext', and the dataset is:





Date Query dataset


SELECT GETDATE()-7 as thedate, '1 Week' as thetext, 1 as theorder
UNION
SELECT GETDATE()-14 as thedate,'2 Weeks' as thetext, 2 as theorder
UNION
SELECT GETDATE()-21 as thedate,'3 Weeks' as thetext, 3 as theorder
UNION
SELECT GETDATE()-31 as thedate,'1 Month' as thetext, 4 as theorder
UNION
SELECT GETDATE()-62 as thedate,'2 Months' as thetext, 5 as theorder
UNION
SELECT GETDATE()-(31*3) as thedate,'3 Months' as thetext, 6 as theorder
UNION
SELECT GETDATE()-(31*6) as thedate,'6 Months' as thetext, 7 as theorder
UNION
SELECT GETDATE()-365 as thedate,'1 Year' as thetext, 8 as theorder
ORDER BY 3
When I go to run the report and selecting a value for the date parameter, there is never any output, and the data selection combo box just gets reset to show <select a value>.

What am I doing wrong?

View 3 Replies View Related

How To Automate Date & Time Stamp In A FILE Name Created Via DTS

Dec 13, 2001

Hi,

I would like to know as to how can I put a Current Date & Time stamp on a FILE NAME automatically which is created by a DTS package.

E.g. I create a file named ABC.TXT daily. How do I get this file to have the current Date stamp so that the file name is ABC121201.TXT without any user intervention.

Thanks for the help!

View 1 Replies View Related

SQL 2012 :: Database Schema Creation Date And User Who Created It

Nov 12, 2014

Query to find the date/time when a database schema was created and who created it.

View 2 Replies View Related

Analysis :: How To Sort A Year In A Dimension Date Created In SSAS

Apr 22, 2015

I create a Dimension Date using SSAS 2008 but when i execute the dimension and i go to see the result i have this result:the result is not sorted..what i need is having the result order by year i mean i have Calendrier 2020,Calendrier 2019 ...

View 6 Replies View Related

Help Simple Search Date

Mar 28, 2008

hello I have this code Select Waste.WasteName AS [Waste Name], InvoiceDetail.Volume, Branch.BranchLocation AS [Branch Location] From InvoiceHeader INNER JOIN InvoiceDetail ON InvoiceHeader.InvoiceNo = InvoiceDetail.InvoiceNo INNER JOIN Waste ON InvoiceDetail.WasteID = Waste.WasteID INNER JOIN Branch ON InvoiceDetail.BranchID = Branch.BranchID Where WasteName = 'Sludge' AND InvoiceDate >= '" + TextBox1.Text + "' AND InvoiceDate <= '" + TextBox2.Text +  "'; The problem is everytime I will search for example InvoiceDate 03/27/2008, I need to add one day for example --> 03/28/2008 for me to be  able to get that Invoicedate 03/27/2008.. What's do you think is the problem with my code?  Thanks!  

View 9 Replies View Related

Simple Date Problem

Apr 13, 2004

hi, when i use the getdate() function, i will get '4/14/2004 AM 11:25:56'. how can i edit the getdate() function to get just the date only '4/14/2004'.

thanks in advance

View 3 Replies View Related

Simple Date Problem Please Help!

Feb 24, 2005

I can get the date to list all of the dates in the recordset, but when I use request.querystring("date") to specify all the recordsets with the date "2/26/2005" for example, the recordset comes up empty. Here is my sql statement:

SELECT eventdate=convert(varchar, eventdate, 101), eventtext, eventtime, location, eventtitle, eventID, picture
FROM dbo.calendar
WHERE eventdate like 'thee' and status='live'
ORDER BY eventdate ASC

this will return everything when the browser url shows this: http://www.kapsi-western.org/calendar.asp?date= However, if we put a date in there, and made it like this http://www.kapsi-western.org/calendar.asp?date=2/26/2005, then nothing comes up even though there is event with that date.

View 1 Replies View Related

Simple Date Problem

Aug 3, 2006

I'm trying to find the first Monday for any given year. I've found something
that works, but I typically find the most convoluted way to do a simple task.
Is there something simpler/cleaner than this?



DECLARE @intYear INTEGER
DECLARE @dtmFirstMon DATETIME
DECLARE @dtmWorkDate DATETIME

SET @intYear=YEAR(GETDATE())+2

SET @dtmWorkDate=CAST('01/01/' +CAST(@intYear AS CHAR(4)) AS DATETIME)
SET @dtmFirstMon=(SELECT CASE
WHEN DATEPART(dw, @dtmWorkDate)=2 THEN @dtmWorkDate
WHEN DATEPART(dw, DATEADD(D,1,@dtmWorkDate))=2 THEN DATEADD(D,1,@dtmWorkDate)
WHEN DATEPART(dw, DATEADD(D,2,@dtmWorkDate))=2 THEN DATEADD(D,2,@dtmWorkDate)
WHEN DATEPART(dw, DATEADD(D,3,@dtmWorkDate))=2 THEN DATEADD(D,3,@dtmWorkDate)
WHEN DATEPART(dw, DATEADD(D,4,@dtmWorkDate))=2 THEN DATEADD(D,4,@dtmWorkDate)
WHEN DATEPART(dw, DATEADD(D,5,@dtmWorkDate))=2 THEN DATEADD(D,5,@dtmWorkDate)
WHEN DATEPART(dw, DATEADD(D,6,@dtmWorkDate))=2 THEN DATEADD(D,6,@dtmWorkDate)
END)
PRINT(@DTMFIRSTMON)

View 1 Replies View Related

Simple Question On Date

Feb 20, 2008

I want today's date (GetDate()), but I want the hour, minutes, et cetera set to 0 as they play havoc with my date comparisons.

How do I do it?

Thanks.

View 5 Replies View Related

Get New Database Created Then Running Script To Created Tables / Relationships

Jun 29, 2015

trying to get a new database created then running a script to created the tables, relationships, indexes and insert default data. All this I'm making happen during the installation of my Windows application. I'm installing SQL 2012 Express as a prerequisite of my application and then opening a connection to that installed SQL Server using Windows Authentication. 

E.g.: Data Source=ComputerNameSQLEXPRESS;Initial Catalog=master;Integrated Security=SSPI; Then I run a query from my code to create the database eg: "CREATE DATABASE [MyDatabaseName]".

From this point I run a script using a Batch file containing "SQLCMD....... Myscriptname.sql". In my script I have my tables being created using "Use [MyDatabaseName]   Go   CREATE TABLE [dbo].[MyTableName] .....". So question is, should I have [dbo]. as part of my Create Table T-SQL commands? Can I remove "[dbo]."? Who would be the owner of the database? If I can remove the [dbo]., should I also remove dbo. from any query string from within my code?

View 3 Replies View Related

Many Thanks In Advance! - Simple Date Function - Please Help!!!

Aug 2, 2004

Hi All,

Does anyone know how to return a date the sql query analyser like (Aug 2, 2004)

Right now, the following statement returns (Aug 2, 2004 8:40PM). This is now good because I need to do a specific date search that doesn't include the time.

Many thanks in advance!!
Brad

----------------------------------------------
declare @today DateTime
Select @today = GetDate()
print @today

View 2 Replies View Related

Trouble With Simple MS SQL Date Criteria

Oct 4, 2005

This seems really simple so I'm suprised I'm having so much trouble. Perhaps I'm just overthinking the whole issue.  I'm trying to write a query that will extract a list of Users from a table that have logged in within the last 90 days.  Sounds easy huh?  I'm still stumped!Here's the basics of the attempted query:SELECT     UserNameFROM        UsersWHERE     (LastLoggedInDate<= DATEPART(dd, GETDATE() - 90))Thanks!

View 1 Replies View Related

Very Simple Date Format Question

Jun 10, 2004

I simply want to format a datetime to be printed out as 'mm/dd/yyyy', instead of 'January xx, xxxx tttt'. For example:

declare @thedate as smalldatetime

set @thedate = (SELECT SampDate
FROM table where tableID = 1)

print @thedate

This has got to be ridiculously obvious. Right??

View 2 Replies View Related

Simple Date Format Question

Apr 6, 2004

Hello Friends ,

As Iam a very beginner to this sqlserver arena , Iam getting more and more doubts. Can anyone of you help to display a date as string type which is of format, "date/month/year hour:month:second:millisecond".

Please get rid of the huge command which Iam using now,

select rtrim(cast(datename(day ,getdate()) as char )) + '/'+ rtrim(cast(datename(month ,getdate()) as char )) + '/' + rtrim(cast(datename(year ,getdate()) as char )) + ' ' + rtrim(cast(datename(hour ,getdate()) as char )) + ':' + rtrim(cast(datename(minute ,getdate()) as char )) + ':' + rtrim(cast(datename(second ,getdate()) as char )) + ':'+rtrim(cast(datename(millisecond ,getdate()) as char )) as date

View 13 Replies View Related

Simple Date Range Query

Apr 30, 2007

Hello

I was wondering if someone could tell me the syntax for a simple date range query. Basically:



select * from TABLE where start date= and end date =



Thanks

View 3 Replies View Related

Simple Question About Date Data Type

Aug 25, 2007

I want to create a procedure where nextvisitdate is a cloumn for date
so when I passed variable @nextvisitdate then which data type I have touse with it.

CREATE PROCEDURE sp_salesman_nextvisitdate

@salesman varchar (50),
@nextvisitdate date (50)

As

Select * from Entry Form

WHERE

@salesman = salesman
AND
@nextvisitdate = nextvisitdate


GO


You Have to Loss Many Times to Win Single Time

View 3 Replies View Related

Simple Todays Date Query Question

Jan 19, 2007

Hi, I have just started using SQL server 2005 reporting. But I am stuck on my select part of the report. I want to bring back all results from a table for todays date (whatever that would be). I have tried:

Where ColumnA = Today()

and a few other Today variations.

Can anybody please help?

Also is there a good site / tutorial which helps with SQL syntax, statements, etc.

Thanks

Dan

View 4 Replies View Related

A Simple Update Query Using A Date - Conversion From Msaccess

Mar 21, 2005

I'm converting an ASP system from using msaccess to SQL Server as the db engine, and I'm stumped on the following query

update
timecard
set
TcdDate = #3/18/05#


TcdDate is defined as a date/time type

It will not run with the date bracketed by # signs, and when I take them out, 1/1/1900 is stored in the dbs. Is there a different symbol to bracket the date with or should I be using a function to convert the date?

View 4 Replies View Related

Urgent: A Simple Question About The Most Asked Topic - DATE

May 7, 2004

Hi,

The subject say it all :)

I have a field which stores date which the datetime datatype... The problem is that I am also getting time information in this stored field.

I just want to extract the date part in dd-Mmm-yy format (e.g. 07-May-04). I tried convert (char (8), MyDateField, 112) but it gives me date in yyyymmdd format. How do I get the results in dd-Mmm-yy format instead?

Thanks.

View 7 Replies View Related

Simple Way To Determine The Number Of Days In A Month For Any Given Date

Jul 20, 2005

DECLARE @varDate datetimeDECLARE @varMonthDate datetimeDECLARE @varYear datetimeDECLARE @varFOM varchar(10)DECLARE @NumDaysInMonth as intselect @varDate = '2/1/2004'select @varMonthDate = MONTH(@varDate)select @varYear = YEAR(@varDate)select @varFOM = CAST(CAST(@varMonthDate as int) as varchar) + '/1/' +CAST(CAST(@varYear as int) as varchar)select @NumDaysInMonth = DATEDIFF (day,@varFOM,DATEADD(mm,1,@varFOM))select @NumDaysInMonth as DaysInMonth

View 1 Replies View Related

Transact SQL :: Retrieve Currently Created Date From Master Table To Load Into Parent And Child Table

May 12, 2015

In Master tabel i have these date datas

2015-05-10

2015-05-11

2015-05-12

SO when i try to load from  Master table to parent and child table i am using using expresssion like 

select B.ID,A.* FROM FLATFILE_INVENTORY AS A JOIN DMS_INVENTORY AS B ON 
A.ACDealerID=B.DMSDEALERID AND A.StockNumber=B.STOCKNUMBER AND 
A.InventoryDate=B.INVENTORYDATE AND A.VehicleVIN=B.VEHICLEVIN
WHERE convert(date,A.[FtpDate]) = convert(date,GETDATE())  and convert(date,B.Ftpdate) = convert(date,getdate()) ;

If i use this Expression i am getting the current system date data's only  from Master table to parent and child tables.

My Problem is If i do this in my local sserver using the above Expression if i loaded today date and if need to load yesterday date i can change my system date to yesterday date and i can run this Expression.so that yeserday date data alone will get loaded from Master to parent and  child tables.

If i run this expression to remote server  i cannot change the system date in server.

while using this Expression for current date its loads perfectly but when i try to load yesterday data it takes current date date only not the yesterday date data.

What is the Expression on which ever  date i am trying load in  the master table  same date need to loaded in Parent and child table without changing the system Date.

View 10 Replies View Related

Can't See New Objects Created In SQL Server From C#

Jul 23, 2007

We have just installed SQL and C# Express. We have lots of experience with SQL, but none with C#. With both the SQL and C# apps running; if we create a new table, view etc, we cannot see that new object from C# only the objects that existed when we opened the apps for the first time (each time).



If we close everything and re-open everything from scratch, the new objects show..!?!?



Thank you for any information on this difficult problem.

View 1 Replies View Related

DB Engine :: Server Log Is Not Created

May 13, 2015

I have SQL 2008 R2 version. The server has enough disk space where the SQL is running. But the log file is not refreshed. in other words a new sql server log file does not create a new file if the old one is full.

View 4 Replies View Related

Track How Many Objects Created On A Server

Jan 23, 2006

Hi,
Does any has a script to track how many objects created on a server on all databases with in specified date range?

Appreciate your help.
Thanks

View 2 Replies View Related

XML Document Could Not Be Created Because Server Memory Is Low.

Dec 17, 2007

The app users getting terminated after getting the following message.

Exception: XML document could not be created because server memory is low. Use sp_xml_removedocument to release XML documents

The SQL platform is SQL 2005 64bit version running on Windows 2003 SP2.

Was wondering if anyone else has had issues like this and if so what could be the possible resolution.

Thanks,

vkumar

View 1 Replies View Related

SQL Server 2008 :: Getting Mail When A DB Is Created

Jan 6, 2011

On our SQL 2008, we'd like to receive a mail when a DB is created, and, if possible get the name of the newly created database IN the mail.

'till now get get mail I didn't find out how to get the name of the DB in the mail... should I use WMI ?

My database mail is configured and I created a WMI event alert with this query:

SELECT * FROM CREATE_DATABASE
+ Additionnal message in the options of the alert...

But I don't know how to get the name of the newly created db unfortunately.

View 9 Replies View Related







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