How To Get File Create Date In SQL Server

Jan 28, 2005

How can I get file created date of a text file using TSQL.

Thank You

Nad

View 7 Replies


ADVERTISEMENT

Get A File's Create/Modify Date

Jun 17, 1999

HOW TO GET A FILE'S CREATE DATE??
From SqlServer I need the create date of a file on C or D.
Is there a function or code to retrieve the create date,
or an API that could read and pass back the file's creation date???

View 1 Replies View Related

Get File Create Date And Time From Within SSIS

Oct 4, 2006

The subject line says it all. I need to be able to do a comparison on a file's date and time to see if it is stale or not.

View 15 Replies View Related

Flat File Text Date Conversion To SQL Server Date Comments And Suggestions

Mar 12, 2008

Hi,
Basically the above is a very common requirement, please comment on my solution which I've arrived at by searching through the web; -

In summary I have used 3 SSIS components these are "Flat File Source", "Derived Column" and "SQL Server Destination".

1) File Connections Manager Editor
1.1) Within File Connections Manager Editor; -
Name the data type e.g. "INTERCHANGE_NET_APP_DATE_SRC"
and assign a type to the data type e.g. string[DT_STR]

1.2) Click on the Preview button to ensure the expected text is assigned to the expected data type.


2) Derived Column Transformation Editor
2.1) Assign Derived Column Name, e.g.
INTERCHANGE_NET_APP_DATE

2.2) Select <add as new column> within Derived Column.

2.3) Enter the conversion Expression, e.g. ; -
2.3.1)
(SUBSTRING(INTERCHANGE_NET_APP_DATE_SRC,8,2) + "/" + SUBSTRING(INTERCHANGE_NET_APP_DATE_SRC,5,2) + "/" + SUBSTRING(INTERCHANGE_NET_APP_DATE_SRC,1,4))

2.3.2)
Since the above conversion is such a common task I suggest that Service Pack 3 of SQL Server 2005 delivers the following functionality; -

STRINGTODATE ('YYYYMMDD',INTERCHANGE_NET_APP_DATE_SRC)

2.4) Select "database timestamp [DT_DBTIMESTAMP] " as Data Type.

2.5) Within the Mappings tab of the SQL Destination Editor have; -
Input Column as INTERCHANGE_NET_APP_DATE and
Destination Column as INTERCHANGE_NET_APP_DATE.

Please comment on the above, I will then pass on my suggestion to Microsoft.

Thanks in advance,

Kieran.

View 1 Replies View Related

Unable To Create Date Bse In Sql Server 2005 Xpress

Jun 2, 2006

Hi everybody my problemis that i cannot create data base in vwd xpress edition when i right click on data connection the only enabled option it show is .."Add connections"create date base option is disable tell me or advised me what to do now ..???waiting for guru replies.regardsHussain

View 2 Replies View Related

SQL Server 2012 :: Create Weeks Calendar From Date

Sep 30, 2015

I need to create a week calendar from date in SQL 2012. Week date starts with Sunday regardless if first Sunday or last Sunday overlaps with previous or next month. For example, the first week in Sep 2015 starts on Sunday 8/30/2015 and ends in 9/5/2015. Too, the last week of Sep 2015 starts on 9/27/2015 and ends on 10/3/2015. Here is the final format:

WeekStartdate WeekEndDate WeekName
8/30/2015 9/5/2015 Sep_Week1
9/6/2015 9/12/2015 Sep_Week2
.....
9/27/2015 10/3/2015 Sep_Week5

View 9 Replies View Related

SQL Server 2008 :: Dynamically Create The Table With Current Date At The End?

Feb 12, 2015

I am running a script by the end of the day. What I need is the rows in my temp table get saved in a permanent table.

The name of the table should end with the current date at the end.

Declare @tab varchar(100)
set @tab = 'MPOG_Research..ACRC_427_' + CONVERT(CHAR(10), GETDATE(), 112 )
IF object_id(@tab ) IS NOT NULL
DROP TABLE '@tab';
Select * INTO @tab from #acrc427;

View 3 Replies View Related

Can Sql Server Know When The Row In Table Saved CREATE TRIGGER Date Time On The ROW ?

Apr 17, 2008

hi i have question

can sql server know when the row in table Saved CREATE TRIGGER date time on the ROW ?
add new field call "date_row_save" date+time
inside the the sql server
i need to know whan the row Saved
is it possible to do this in TRIGGER ?
TNX

View 3 Replies View Related

What Is The Dump File In SQL Server? How Do I Create It?

Mar 24, 2005

what is the dump file in SQL server? how do I create it?

View 1 Replies View Related

How Do I Create A SQL Server Job To Execute A .exe File?

Jun 10, 1999

I am having trouble getting a job step to execute an executable file. One of the options for a job step is to enter an operating system command. I have tried entering the following operating system command to execute a file:

'start c:myfile.exe'

For some reason this doesn't work. How can I get SQL Server to execute an executable file?

View 3 Replies View Related

Create A Linked Server To MPP File

Apr 13, 2007

I have created a linked server that connects to "mpp" file, and it connects and opens successfuly returning a list of tables that exists in the linked server to the mpp file.

But the problem i am facing now that whne i write a select statment to get data from the tables in this linked server

select * from linktompp.testmpp.dbo.tasks

such that linktompp is the linked server name
testmpp is the catalog name
tasks is the table name i need to select data from

it shows an error that says

"Could not obtain a required interface from OLE DB provider 'Microsoft.Project.OleDB.11.0'."

"[OLE/DB Provider 'Microsoft.Project.OleDB.11.0' IUnknown::QueryInterface returned 0x80004002: IGetDataSource]"
could anyone tell me the reason of this error

thanks




Mostafa Salama
M.Sc. in Computer Science

View 1 Replies View Related

By Vb.net Create Exe File To Update Sql Server

Oct 5, 2006

is there any chance to create an exe file to update the sql server database by uisng windows schdule ??



for example this exe file will run to update my database, every night @ 12:00 AM.

this exe should be in vb.net



pllllzzzz help

View 2 Replies View Related

Create A Flat File On A Remote Server

Jul 11, 2006

Hi,

In the new flat file connection dialog box, can i create a flat file on a remote server? thanks.

View 1 Replies View Related

How To Create A Setup File To Install Sql Server Database

Jun 7, 2005

Hi All,   I'am looking for a software (Installer) to create a setup file to install a SQL Server Database just like the one in the Reports Starter Kit, when you install it a dialog will guide you to instaal the database thats what i'am looking for.  Anybody knows how can i do that or is there a software that can help me doing that.Best Regards.Wafi Mohtaseb

View 2 Replies View Related

SQL Server Admin 2014 :: Create Format File For BCP

Nov 10, 2014

We have one table where we store all documents in one of the column called "Doc" with varbinary(max) data type.

We want to download those documents from sql table to windows explorer and i wrote BCP in sql 2005. And things were fine.

The format file I used there looks like this,

9.0
1
1 SQLBINARY 0 0 "" 1 Doc ""

Now we are in 2014 and when I try the same code with same format file, it hangs in the middle. So I changed the file to 12.0 instead of 9.0 but still not working.

View 0 Replies View Related

Create A Backup File And Restor In SQL-Server 2000

Oct 3, 2005

Hallo!

I would like to create a backup file in SQP-Server Express and restor this backup-file in SQL-Server 2000.
I am looking for the command that produces the .bak-file.

Thank you very much!

Regards,
Fabian

my favorit hoster is ASPnix : www.aspnix.com !

View 3 Replies View Related

Can't Create Excel File With SQL Server 2000 Client.

Jan 3, 2007

Hi ;

I am trying to create several Excel sheets using SQL 2000 views like so:

Select * INTO [Excel 8.0;Database="C:spreadSheetsaNew.xls"] FROM [aView].

When I try and execute this in my app I get the following - Specified owner
name 'Excel 8.0;Database=c:spreadSheetsaNew.xls' either does not exist or
you do not have permission to use it.

If I use the above Select statement with an OLEDB connection it works.

I am using Imports System.Data.SqlClient, instantiating a new SQlConnection
object, opening the connection, etc..

Thanks,

Gordon

View 1 Replies View Related

How To Create Linked Server To Access 2007 Accdb File?

Feb 20, 2008

How does one create a linked server to an Access 2007 (accdb) file? I am aware that to create one to a mdb file, the code would be -EXEC sp_addlinkedserver
@server = 'SEATTLE Mktg',
@provider = 'Microsoft.Jet.OLEDB.4.0',
@srvproduct = 'OLE DB Provider for Jet',
@datasrc = 'C:MSOfficeAccessSamplesNorthwind.mdb'
GO
What is the corresponding code for Access 2007 accdb files?

View 18 Replies View Related

SQL Server 2000 - Create An Excel File By Stored Procedure..

Mar 3, 2008

Can I create an excel file by stored procedure?

View 2 Replies View Related

How And Where Should I Create A Mdf File If I Installed A Sql Server 2005(Developer EditioN)

Aug 31, 2006

hi:

I am a newbie to sql server 2005 (developer edition). Now I installed both sql server and VS 2005 professional edition on my machine.

I just what to know how and where should I create a mdf file on my server or .net window project because I try to combine to it from a window application. Should I use the sql server management studio or the Visual Studio 2005 ? What is the generate steps to create one?

I am completely confused. Please help me, I cannot find related on line source.



Thank you, thank you

bigheadjj

View 7 Replies View Related

Can I Create Database Using Backup File In SQl Server 2005 Express Edition

Jul 21, 2007

hi
       i have a database file backup which is having no extension (eg saims) . Can i create a database using this backup in sql server expression edition.
 Or else is there any way to get the .mdf file from sql server 2005 full edition??????????????
Thanx in advance

View 2 Replies View Related

Unable To Create A New File Data Source: SQL Server Does Not Exist Or Access Denied

Jun 22, 2004

Hi ,

I have just downloaded an evaluation version of SQL server from the microsoft website and installed it in my PC.

Now I want to create file data source.

I followed these steps:
-From the control panel, ODBC datasource admin
-click the DSN tab
-click the add button
-select the sql server driver, enter the data source file name
-enter "local" in the server text box as I installed the sql server in my standalone PC.
-click next
After that I had this error.
"Connection failed. SQL server does not exist or access denied."

But The sql server service is running.

Can anyone help me where did my configuration go wrong??
Thanks...

Nov

View 2 Replies View Related

SQL Server 2008 :: Create All Procedures Located In A Folder One By One And Saving Output File

May 15, 2015

I am asked to create 100 procedures to a database. Any best way to create them in a database one by one by calling the files and saving the execution output files in a folder?

View 9 Replies View Related

Import Flat Text File String Date To Database Date

Jan 30, 2007

I asked this question below, but the answer was that the conversion will take place automatically, but I can't get that to happen. I have a flat file with an 8 position field that I identify as string (and I also tried date) that is yyyymmdd and it needs to go into the database field that is datetime format. IS there something I am doing wrong with the definition of it, or do I need to add some kind of conversion, and if so, what and how would that be done. I'm a dts Sql2000 expert, but the SSIS thing is driving me crazy. I have a ton of dts' to convert and the migration tool doesn't work because there are a lot of active X scripts in them. thanks for your help. Boston Rose

View 1 Replies View Related

SQL Server 2012 :: Create XML File From AS400 Stored Procedure Returning Multiple Datasets

Oct 3, 2014

I have a store procedure in MC400 which I can call from SSMS using the below command:

EXEC ('CALL GETENROLLMENT() ')At serverName

Now this command returns two data sets like:

HA HB HC HD HE
1112
112571ABC14
113574ABC16
114577ABC87
DADBDCDD
1115566VG02
1115566VG02
1115566VG02

I want to generate two different XML files from these two datasets.Is there any way this can be achieved in SSIS or t-sql ?

View 3 Replies View Related

How To Create, Install And Deploy Dts File For Sqlserver 2000 And Dtsx File For 2005 ?

Apr 24, 2007

Hi,



I am looking for tutorials about how to create dts et dtsx files.

Thanks for your help.



Arioule.

View 1 Replies View Related

Cannot Attach Mdf: Create File Encountered Operating System Error 5 While Attempting To Open The Physical File...

Sep 5, 2006

I have used the copy database wizard, but I realized I had forgotten to shrink the transaction log file. So I canceled the wizard. My database, detached by the wizard, has now disappeared. The mdf file is still there, but when I try to attach it manually I get the "create file encountered operating system error 5 while attempting to open the physical file..." error.

Any way I can recover it?

Thanks.

View 4 Replies View Related

Save Some Stored Proc In File And Create SP From File

Jul 27, 2006

Every day we are restoring prod DB in Development env. I need to save before restore users stored proc,

restore DB and after create SP from file.

Thanks.

View 3 Replies View Related

Flat File Destination - Don't Create File If 0 Records

Apr 17, 2008

Hello friends,

I have the following (simplified):

1. Flat File Source
2. Conditional Split, Case Good = !ISNULL(KEY) Case Error = ISNULL(KEY)
3. Case Good -> Writes to Good Flat File (with timestamp in the title)
4. Case Error -> Writes to Error Flat File (with timestamp in the title)

Most job runs have no errors but the error file is created as a zero byte file anyway. If there are no error records I don't want the error file created. How might I accomplish this?


Thanks

View 5 Replies View Related

SQL Server 2008 :: Bulk Import And Create New Table Based On Header Fields Of Imported File (XLXS)

Sep 11, 2015

I have a record in an Excel format (Excel 2010) and I would like to bulk import that into SQL Server 2008 and also while importing, SQL Server will automatically create a new table based on the header fields or row of the source file.

I am not sure if SQL Server 2008 has this capabilities.

View 0 Replies View Related

Integration Services :: Excel Destination With Run Date-1 Inside File Not The File Name

Aug 26, 2015

I have a ssis package where I need to have excel destination.  In the Excel file, I need to have few rows with some text and then populate data below the text. One the text is like this:

Data as of:  08/25/2015

if the report ran today, then Data as of will have Yesterday. So, if the user opens that excel file after a week, then user should see same  Data as of:  08/25/2015. not today()-day(1).

I was planing to handle on excel side with today()-day(1). but it only works the day it was run. Then the excel file is open after few days later, then it might as Data as of:  08/30/2015 which is not true. It should still stay Data as of:

 08/25/2015 on what ever date the excel file is open. The SSIS package  runs only once. 

How do I handle this so that whenever user open the file, they will see Data as of:  08/25/2015. This is not a column in excel. It is like a description of data in excel.

View 3 Replies View Related

DB Engine :: Cannot Create A File When That File Already Exists

Aug 18, 2014

Executed as user: S233683-AD01S233683NJ3SQL05. ...at file already exists.' [SQLSTATE 42000] (Error 22048)  ERROR -- Could not backup database: master - BACKUP DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 50000)  xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'

View 2 Replies View Related

Batch File To Copy File And Append Date

Jan 5, 2005

The Sql Server database can only see the local drive.

I would like to set up a batch file that will copy a SQL Server

backup file from the local drive to the network drive. I would

like to append the file date to the end of the copied file. I

assume a batch file can accomplish this but I am new to batch

file writing. Does anyone have code that they already created

for this sort of task??

Thank you!

View 13 Replies View Related







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