File Properties

Dec 30, 2004

Hi all,

I'm having a problem need your help:

I can see all properties of datafile (FilegroupName, FileID, FileType,
Location, CurrentSize, Space Used) by Enterpise Manager.

Please tell me how do I see all those properties by SQL Query Analyzer.
I want to know actual space used in data file to shrink file.

Thanks in advanced,
TN

View 5 Replies


ADVERTISEMENT

Integration Services :: Pulling File Based On File Properties

May 6, 2015

I have a task for which I have to load csv file from a shared directory into sql table. Right now I'm stuck with a road blocker, The issue is the shared drive contains all the history files as well and I have to pick only the latest file. But I cannot identify latest file based on the file name because it doesn't contain any date in the file name. However by seeing file properties I can pull latest file. 

Sample file name: XXX_XXX_XXX_XXX_XXX-5814201.csv

Is there any way we can automate this in SSIS with file properties and picking the latest one?

View 12 Replies View Related

Unable To Edit Pre-defined Flat File Connection Manager Properties In The Flat File Destination Editor

Aug 24, 2007

Hi,

I am testing SSIS and have created a Flat File Destination. I defined the Flat File Connection as New for the first time and it worked fine. Now, I would like to go back and modify the Flat File Connection in the Flat File Destination Editor, but it allows only to create a New connection rather allowing me to edit the existing one. For testing, I can go back and create a new connection, but if my connection had 50-100 columns then it would be an issue to re-create it from scratch.

Did someone else faced this issue?


Thanks,
AQ

View 1 Replies View Related

SQL Server BCP Sensitive To OS File Properties?

Jul 28, 2004

This problem concerns files FTP'd (using True64) from an AIX app, to an WIN server

These files can't be loaded into the SQL Server DB using BCP (String data, right truncation) nor into an ACCESS DB ("Overflow"), (but can be loaded into Excel).

If the file is opened and saved in a Windows/DOS environment it loads fine, or contents copied to an empty win/dos file.

If the same file is sent from to the Win server using DOS FTP then it loads fine.

It seems to be that these DBMS's don't like something about the operating system level file properties (hdr or EOF?).

Can any one help?

View 1 Replies View Related

Table Function To Retrieve File Properties

Mar 25, 2008

Here's a table function that returns a table variable containing various file properties (creation date, size, etc.). The one limitation to remember is that it won't work with files on mapped drives; you have to use the full \<Server><Share><Folder1..Folder n><Filename> syntax. Still, it's a pretty useful thing to have around. :)

/****************************************************************************/
CREATE FUNCTION fnc_GetFileProps

(@FileName VARCHAR (1024))

RETURNS @Results TABLE (
ErrorCode TINYINT DEFAULT (0),
PropName VARCHAR (255),
PropValue SQL_VARIANT
)

AS
BEGIN
DECLARE @OLEResult INT
DECLARE @FS INT
DECLARE @FileID INT
DECLARE @Message VARCHAR (8000)
DECLARE @ErrorSource VARCHAR (255)
DECLARE @ErrorDesc VARCHAR (255)
DECLARE @INT INT
DECLARE @VARCHAR VARCHAR (1024)
DECLARE @DATETIME DATETIME
DECLARE @BIGINT BIGINT

-- Create an instance of the file system object
EXECUTE @OLEResult = sp_OACreate 'Scripting.FileSystemObject', @FS OUT
IF @OLEResult <> 0
BEGIN
EXEC sp_OAGetErrorInfo @FS, @ErrorSource OUT, @ErrorDesc OUT

INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, @ErrorSource, @ErrorDesc)

RETURN
END

EXEC @OLEResult = sp_OAMethod @FS, 'GetFile', @FileID OUT, @Filename
IF @OLEResult <> 0
BEGIN
EXEC sp_OAGetErrorInfo @FS, @ErrorSource OUT, @ErrorDesc OUT

INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, @ErrorSource, @ErrorDesc)

RETURN
END

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Attributes', @INT OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Attributes', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Attributes', @INT)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'DateCreated', @DATETIME OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'DateCreated', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('DateCreated', @DATETIME)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'DateLastAccessed', @DATETIME OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'DateLastAccessed', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('DateLastAccessed', @DATETIME)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'DateLastModified', @DATETIME OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'DateLastModified', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('DateLastModified', @DATETIME)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Name', @VARCHAR OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Name', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Name', @VARCHAR)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Path', @VARCHAR OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Path', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Path', @VARCHAR)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'ShortPath', @VARCHAR OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'ShortPath', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('ShortPath', @VARCHAR)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Size', @BIGINT OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Size', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Size', @BIGINT)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Type', @VARCHAR OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Type', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Type', @VARCHAR)

EXECUTE @OLEResult = sp_OADestroy @FileID
EXECUTE @OLEResult = sp_OADestroy @FS

RETURN
END
/****************************************************************************/


I geek, therefore I am

View 1 Replies View Related

Integration Services :: File Properties Script Task

May 14, 2015

I would like to store the file properties like (title, created by , created time, modified time) and load in to a audit table along with file name. I know how to design this process inside a foreach lookup with script task and execute sql task.

I'm trying to achieve this by editing my existing code which captures the most recent file based on its file properties. 

public void Main()
{
// TODO: Add your code here
var directory = new DirectoryInfo(Dts.Variables["User::Csv_Source"].Value.ToString());
FileInfo[] files = directory.GetFiles("*.csv");
DateTime lastModified = DateTime.MinValue;

[Code] ....

View 3 Replies View Related

SQL 2012 :: Connection Properties Versus SSMS Server Properties

Mar 16, 2015

I have an ODBC connection string that is working fine with the following properties:

Database="XXXXXXX",Network="YYYYYY"; strangely no server is specified in the string, but it is specified in the ODBC Connection file.

I am trying to do a new server registration in SSMS for this database.However, I don't understand where the network spec is placed.

Under Registered server name I've tried:

YYYYYYXXXXX

When I browse the server for the database instance list, I receive "network path was not found".

I even tried:"XXXXXXX",Network="YYYYYY" for the registered server name.Same error message.

What am I doing wrong ?

View 1 Replies View Related

Adding Static Column Of Data From Properties File To DB Import

Sep 4, 2007

Hey all-

I put togehter a package that opens a flat file, parses the data based on the semi-colon delimeter, and imports the rows into a database table. Thats the fun easy part.

What I cant figure out is how to add a variable that will hold a constant ID value that will be persisted with the same value to all rows inserted to the DB. Making the problem harder, I would like that this value be defined in a properties file or database table of some sort so that I can do a lookup based on the file name / location to find out what value should be used.

Any suggestions? I hope my explanation makes at least some sense - but basically I want to do a look up in a configuration of some sort, pull out a single value, and add it to a data import.

let the fun begin!!

View 4 Replies View Related

Moving Text File Properties For Sql2k Dts To Sql25k Ssis Packages???

Jun 2, 2006

Hi everyone,

We€™ve got almost 250 old dts packages which simply loading data into Sql tables from plain files or at the reverse point. Most of them are defined with fixed fields and its fixed positions one after one. We don€™t want to migrate them using Import wizard, on the contrary we€™re producing them from the beggining taking advantatge of SSIS architecture to the full.
And now, we€™re trying to imagine how to migrate automatically that valuable info from Sql Server 2000 to Sql Server 2005 without efforts€¦ You know, any program be able to move that detailed info
to SSIS.

So we would avoid to select again all these positions per each file -very tedious and we're lazy


I don€™t see how except, of course, migrate them directly

Let me know if you need further explanations or more clarity on that.

View 5 Replies View Related

Redefining Columns Isn't Possible With Flat File Connection Manager Editor Properties Already Fixed??

May 29, 2006

Dear fellows,

I know that I think as sql2k programmer-dba yet but I can€™t avoid.

I€™ve got Flat File Connection Manager Editor dragged with a text file as €˜ragged right€™ format and CRLF as header row limiter. When from properties page and Columns option I€™m going to alter just a few colums I am not be able.
It seems that you must erase all of them in order to define one or two. And in the case you€™d have 50????
When I ran sql2k DTS designer did that without problems, alter columns again and again.

As far as I know it€™s a lose of flexibility, or not? Or is there any way for do that without deleting nothing else?

View 3 Replies View Related

Reg:- Assign File Properties To SSIS Varibales(Custom Task) In Property Grid Progrmatically.

Jul 6, 2007

HI,

I need to open a File through File connection manager and want to assign these file properties to SSIS precreated varibale or Newly created varibale. I want to show file properties in Propertygrid. Properties grid will conatin File Propeties Column and SSIS varibale Combobox column. The combo box will contain New variable field. When user select New Variable field, then a new SSIS varibale window will open and we can able create New variable and that Newly created variable should add to that property comboBox.



For Instance if we create a new varibale Name "Creationdate" by clicking on New Varible in ComboBox, then that CreationDate variable should add to Property ComboBox in PropertyGrid. After adding when we select that variable Name "Creationdate" then that selected file Creation date should assign to SSIS varibale "Creationdate" field.



Any Comments or sample will help me.



Nitin

View 2 Replies View Related

New 2005 SSIS Task: File Properties Task

Nov 7, 2007

A common issue that I run across with clients is they want only want to process a file if it's finished transmitting to the server. This SQL Server 2005 task reads the properties of a file and writes the values to a series of variables. For example, you can use this task to determine if the file is in use (still be uploaded or written to) and then conditionally run the Data Flow task to load the file if it's not being used. You can also use it to determine when the file was created in order to determine if it must be archived.

http://www.pragmaticworks.com/filepropertiestask.htm

View 5 Replies View Related

Database Properties

Oct 31, 2007

is there anyway to retrieve the database properties and display in an asp.net web form as a quick over view rather than logging onto the server to check, items such as size, space available, last backup data etc? Cheers 

View 2 Replies View Related

Sql Login Properties

Oct 19, 2000

Hi and thanks for your help
specifying the default database means what. for instance when I add alog in user and I have to choose a default database. Does it make a difference if the Default database is Master or any other user database name. What is the significant to select Master vs any other database.


Thanks,

Ahmed

View 1 Replies View Related

Server Properties

Oct 11, 2002

Hello!
We are having problems with a single SQL Server where the Server properties will not save, and always revert to the default.
It occurs only on those tabs with "configured" and "running" options at the bottom. Other tabs will keep the settings we custom.
The big problem is with the memory and processor tabs which even when we've made only a single change and stopped and started the service, reverts back to a default.
Any clues - we are logged in as "sa" and have not removed the SA priviledges.

Thanks for any help,
Simon

View 1 Replies View Related

Properties Hangup

Apr 4, 2003

Once upon a time, I went to check the properties of an instance and EM just hung - anyone know why this might happen?

View 1 Replies View Related

Help ::: Extended Properties

Aug 15, 2002

Hi all,

Plz help me to know whats wrong with following script:

EXEC sp_addextendedproperty
@name = 'col_Programs_ID_Description',
@Value = 'The Unique Identifier for a specific Program',
@level1Type = 'Programs',
@level2Type = 'ID'

I get the following error:
Server: Msg 15600, Level 15, State 1, Procedure sp_addextendedproperty, Line 42
An invalid parameter or option was specified for procedure 'sp_addextendedproperty'.

NOTE: If I dont use the last 2 parameters this procedure runs fine, but it adds the Extended Property to the Database Level while I'm trying to add it to the TABLE-->COLUMN level.

Thanks
Mariah

View 2 Replies View Related

Right-click Db Properties EM Goes Bye Bye

Jan 11, 2005

Running SQL2000 SP3.

We installed an application named Streamserve. Now, if I go into Enterprise Manager I can expand the databases fine. But when I try to right-click properties Enterprise Manager goes bye bye. No error messages. I tried this on master and same thing. I currently have 2 different machines - a dev and a QA box and both are behaving badly.

Any ideas?

Thanks
Sharon

View 4 Replies View Related

Properties Of Jobs --&> New Job?!

Apr 25, 2008

Hi,

when ever I try to look at the properties of a job, the create new job window appears. what gives?

View 7 Replies View Related

Database Properties

Sep 28, 2007

When I create a new database it asks for information regarding the Data files.

What is it for? Will this file get creted to the location that I write?

How often will it get copied there?

View 1 Replies View Related

Server Properties

Dec 7, 2006

Help;Im New with a company and the sql server ismaxing out the cpu'sWe have 3 web servers load balanced....large volume of datathe current PropertiesComputer:4 amd 2.88 processors4 g MememoryRecomendations of good sql setupmemory, cpu etcThank youmike

View 6 Replies View Related

Missing Properties???

May 23, 2007

Has anyone tried to open a cube into Business Intelligence Studio and the properties for the database vanished (project menu, properties)?

How do you get them back?

View 3 Replies View Related

Image Properties

Jun 26, 2007

Hello



Im having abit off trouble with my images positioning..



I have 3 images in the header placed side by side with a rectangle around them sent to the back

In layout view the images look correct, however when i deploy the report the rectangle appears on top and then the images appear undernealth each other...when they should be inside the rectangle. is there something like float on top properties similar to objects in Word?



A separate question, I also have a table to the right off the table i have an image and under that image another image...when i preview the report the second image is pushed to the bottom of where the table ends...is there someway to make the image appear side by side to the table instead off getting pushed down to the bottom...something similar to a frame in HTML ?



thanks







View 3 Replies View Related

Database Properties

May 9, 2007



Hi.



I am trying to look for ways on how to get all the databse properties under each instance.

say I want to view the size, recovery model, physical location, etc.



The sys.database_files is only applicable per database. Is there a query, or a table in master database to get these or store these values?





thanks...

View 3 Replies View Related

Extended Properties

Jul 11, 2007

Hi:



Does anyone know of a good primer on extended properties and why I would want to use them. I have you the on-line books sections but that does a clear "why". I have search for white papers and similar documents.



I understand they are good for documentation, but I was looking for something that explain Microsoft long-term vision. How I might use them in template scripts, VSTS, etc.



Thanks in advance for your help.



Gene

View 1 Replies View Related

Set C# Parameter Properties

Jul 26, 2006

Hi all, Is it possible when creating a stored procedure through visual studio using a sql server 2005 project, to set the sizes of the parameters that are specified. For example:

public partial class test{ [Microsoft.SqlServer.Server.SqlProcedure] public static void addRecord(string name, string details) { ................. some code ................. }}
Would it be possible to set the size of the parameter 'details' to nvarchar(max) and 'name' to nvarchar(50) or something along those lines. The problem at the moment is that when this project is deployed both of the parameters are set to 4000 characters and sometimes the details parameter are greater than 4000 characters and it is being truncated.

I am currently running some sql that alters the procedure to set the sizes of the parameters but this isn't really an ideal solution.

Any help would be gratefully appreciated.
N


View 5 Replies View Related

Database Properties

Mar 4, 2008

I am trying to find information on Database properties - more specifically, what the 'Space Available' means, because right now when I look at the properties of a database I am setting up, which will grow substantially I am sure, it says the database size is 154 MB and the Space Available is 42 MB. What is the Space Available? What does this refer to and is it going to be restricting the growth of the database? Thanks.

View 7 Replies View Related

Set Chart Properties

May 12, 2008

Hi,

I have a chart that is created in SSRS with the size property set to '15cm, 8.5cm', I want to set the height based on a parameter that is passed to the chart ( so that it fits onto a 1 page report it is fed through to), I have tried putting =Code.SetChartHeight() in the height property but it brings up an error saying it needs to be in a format like '8.5cm'. The SetChartHeight() function just returns the height parameter + 5.

Does anyone know how I can do this?

Many thanks in advance

View 4 Replies View Related

How To Use Query To Get Sql Database Properties

Oct 2, 2006

Hi,I'm creating a User Interface to display Sql database Properties, but I cannot find the right query to retrieved the info on database properties. The status that I get is "ONLINE", but it should be "NORMAL". Cannot find the right query to get the date of last database backup, last transaction log backup, and maintenance plan, etc.. Please help me [:'(]  

View 2 Replies View Related

Where Are The SQL Server 7.0 Configuration Properties

Mar 22, 2000

Is there no longer a graphic interface for the parameters that are output with sp_configure?
There are many options that are settable that are not in the Sql Server Propreties, but
these items were in the 6.5 graphic interface through EM ex. number of open objects.
Is there a script to save these settings so the installation can be recreated?

View 1 Replies View Related

Changing Properties In A DTS Package

Sep 26, 2000

Is it possible to change the database name defined in the destinatation table definition of the transformation object programmitacally?

We have different database names between dev and prod. The package was created against dev. I'm trying to copy the package to the prod server and programmatically change the database name where necessary.

View 4 Replies View Related

Help !!! - DTS Package - Advanced Properties

Feb 27, 2001

Has anybody used the "Use fast load" or "Table lock" options in the advanced DTS package properties ? These are supposed to be in the Advanced tab of the Data Transformation Properties dialog box. I cannot seen to find them. I want to set them in order to have the load execute in nonlogged mode. Any help would be very much appreciated.

Thanks in advance.

View 2 Replies View Related

Best Way To View Table Properties

Apr 28, 2003

Can anyone help me with displaying several table properites at once. I know I can use sp_help 'tablename' to get one at time. What is the best method to get several databases at a time?

View 5 Replies View Related







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