Created BAT File Just To Make A Directory Not Getting Recognized

Aug 13, 2015

i am trying to run an exe using t-sql command and even through job, but it is giving me issues. But if i double click on the exe it runs fine.

For example i created a bat file just to make a directory - mkdir d:example
double clicking it, a folder is created BUt through
EXEC xp_cmdshell "D:ew.bat"
it gives me error -
'D:ew.bat' is not recognized as an internal or external command,

and when i do with the job with command - @command=N'idhimahajanD$ew.bat',
it gives an error on execution - Executed as user: NT ServiceSQLAgent$PAXAS. The process could not be created for step 1 of job 0x2FCDDE36F160CD4688D2ACE1D748A99E (reason: Access is denied). The step failed.

View 3 Replies


ADVERTISEMENT

Check Directory To Make Jpg File Exist

Mar 6, 2012

We have a database called Itemphotos. In this table is a field called 'PID' picture ID. We have a photos directory with files like 2181.jpg, 2182.jpg, 2184.jpg. The number is the ID number for the picture of the part. If a record exist in the database based on the PID "Primary Key" , check the directory to make sure the jpg file exist. Here is the code I have so far.

use [ItemPhotos]
select pid from dbo.itemdata
declare @file_path nvarchar(500)
declare @file_exists
int set @file_path = 'av-sql2c$inetpubphotosmacolaphotos' + [itemdata].[pid]

[code]....

View 7 Replies View Related

Reporting Services :: How To Make New Directory (folder) In Which To Save New SSRS Report

Sep 17, 2015

When I go to Save As Report it doesn't allow me to create a new directory (folder)

Here is where the directory (folder) needs to be created: gdgdb01preportserverProduction.

Where can I create this directory (folder)?

View 4 Replies View Related

Loading Flat File - Row Delimiter Not Recognized

May 2, 2007

I have a text file that loads just fine with DTS 2000, but in SSIS it does not seems to recognize the row delimiter. For example, most rows in the text file have 10 columns, but some have 8 columns. For those with 8 columns, the SSIS is adding the data from next row, not padding the columns with nulls. Please help...



Thanks in advance.

View 16 Replies View Related

Package Configuration File Issue - Relative Path Not Recognized In VS2005

Feb 7, 2008

I have been reading through different posts about how to manage SSIS configuration files across multiple environments. I have seen a few that mention a solution that turns out not to really work (or maybe Im doing something wrong); which is what I hope to find out here.

Solutions I am working with:
1: Put the XML Configuration file in the same directory as the SSIS package and only specify the config file name when setting it up in the package. I do not specify a path to the XML Configuration file, just the config file name.

ISSUE: This works when I first create the package and test it without closing down visual studio. Even after deploying the SSIS package and the config file and moving it between environments it works as long as the working directory of the DTExec command is the same directory as the SSIS package and configuration files. The problem comes in after I have closed Visual Studio and opened it again and loaded up the SSIS package. It then gives a bunch of errors stating that it cant locate the configuration files. If I could fix this issue, then this would be a solution that I could live with. (I would much rather use a relative path to a different directory but Ill live with what I can get). Can anyone solve the issue of Visual Studio 2005 not recognizing the location of the configuration files when only the configuration file name, and not the path is specified?

-- The other odd thing is that I have been able to get this to work consistently with some of my packages but not others. I'm not sure what I did to get those packages to recognize the location of the xml config file.

Thank you in advance for any input and help.

View 27 Replies View Related

Integration Services :: File System Task - Set Source Variable And Pickup BAK File In Directory To Delete

Nov 9, 2015

I have created a File System task which is contained in a Foreach Loop Container. I have .bak files that are populating a directory from a maintenance backup plan.

There is a point where I need to delete the .bak file's after I've zipped them all up.

How do I set the SourceVariable to read through the directory and pick up just the .bak file's in the directory to delete.

View 3 Replies View Related

Integration Services :: Flat File Error File Being Created In-spite Of No Errors

Jun 23, 2015

I have a package in which there are only one Data flow Task and it has only three components. 1) Source , which is a SQL db 2) destination and 3) OLE DB Destination flat file Error output file.   I want the error file to be created ONLY if there is any error while dumping the data into destination DB. But , the issue is, the error flat file is being created inspite of No error while dumping the  data from Source to Destination.

View 5 Replies View Related

Integration Services :: Get FileName Fo Each File Created Via Dynamic Flat File Destination

Jul 24, 2015

Need to know how I can get the dynamic filename created in the FlatFile destination for insert into a package audit table?

Scenario: Have created a package that successfully outputs Dynamiclly named flat files { Format: C:Test’Comms_File_’ + ‘User::FileNumber’+’_’+Date +’.txt’

E.g.: Comms_File_1_20150724.txt, Comms_File_2_20150724.txt  etc} using Foreach Loop Container  :

* Enumerator Set to: “Foreach ADO Enumerator” with the ADO object source variable selected to identify how many total loop iterations there are i.e. Let’s say 4 thus 4 files to be created

*Variable Mappings : added the User::FileNumber – indicates which file number current loop iteration is i.e. 1,2,3,4

For the DataFlow task have a OLDBSource and a FlatFile Destination where Flat File ConnectionString is set up as:

@[User::Output_Path] + "Comms_File"+ @[User:: FileNumber] +"_" + replace((DT_WSTR, 10) (DT_DBDATE) GETDATE(),"-","")+ ".txt"

All this successfully creates these 4 files:

Comms_File_1_20150724.txt, Comms_File_2_20150724.txt, Comms_File_3_20150724.txt, Comms_File_4_20150724.txt

Now the QUESTION is how do I get these filenames as I need to insert them into a DB Audittable. The audit table looks like this:

CREATE TABLE dbo.MMMAudit
  (
     AuditID      INT IDENTITY(1, 1) NOT NULL,
     PackageName     VARCHAR(100) NULL,
  
FileName           VARCHAR(100) NULL,
     LoadTime        DATETIME NULL,
     NumberofRecords INT NULL
  ) 

To save the Filename & how many records in each file in our Audit Table, am using an Execute SQL Task and configuring it as this:

Execute SQL Task

Parameter mapping - Mapped the User Variable (RecordsInserted) and System Variable( PackageName) to Insert statement as shown below

SQLStatement: INSERT INTO [dbo].[MMMAudit] ( 
PackageName,NumerofRecords,LoadTime)
 (?,?.GETDATE)

Again this all works terrific & populates the dbo.MMMAudit table as shown below BUT I also need to insert the respsctive file name – How do I do that?

AuditID PackageName FileName  NumberOfRecords
1           MMM       NULL                      12
2          MMM  NULL                23
3          MMM  NULL      14
4          MMM  NULL              1                     

View 2 Replies View Related

How To Read A File In A Directory Using T-Sql

Mar 3, 2008

Hi,
I need to read a XML file inside my procedure and put its contents in a variable.
How do I do it?
Is there a dbo procedure to do it?

Cheers,

View 2 Replies View Related

Splitting Directory And File Name

Feb 19, 2006

First of all apologies for posting this again but I posted it in thewrong place the first time.Can anybody help me with the post below?http://groups.google.com/group/SQL-...5ec9f04d978d0deThanks,Paul

View 1 Replies View Related

What Directory Would Be Best To Store The .SDF File In?

Jan 13, 2006

I am creating some applications for Windows Mobile 5.0 devices to be used internally at our company. Each device will run several home grown applications that will all share the same common SQL Mobile database.

What I am wondering is whether or not there is a standard path where such a database is typically stored in Windows Mobile 5.0. I see a folder called Application Data. Is that what it is for, or is that one for something else? I'm not real familiar with the layout of the Pocket PC in general. Could someone tell me where vendors normally put their database file(s)?

Thanks,

Brad

View 1 Replies View Related

Where Do I 'Set Directory' For File DSN On Vista?

Jul 19, 2007

I did something stupid. I was messing around with a file DSN and deleted it. I can't seem to recreate it either. I "set the directory" in the ODBC dialogue to a location I liked better and moved the file DSN there. It didn't work when I tried to use the applications on my system later on (huh, shooting self in foot...). (using vista ultimate 64-bit). One of the databases is SQL 2005 Express, and the other is an Access database.

Maybe I lost all my ODBC connections? Neither databases work now... When I am in the File DSN tab and click "Add" I have only two drivers showing up (SQL Native Client and SQL Server) in the Create New Data Source window. Do I need to add an ODBC driver? Any better documentation on File DSNs? (or using the ODBC Administrator)... the help documentation is REALLY lacking!!!

View 1 Replies View Related

Getting Directory Name And File Name From Path

Dec 12, 2007

I have a sql compact table that stores a series of directory paths like so:
C:F1BackupadministratorCDatakit.zip__--1-07272007124351.F1O
C:F1BackupadministratorCDataDeploySMD_FSWsetup.exe__--1-11292007122443.F1O
C:F1BackupadministratorCDataDeploySMD_FSWSMD_FSW.application__--1-11292007122443.F1O

Is there a way in sql that I can get just the directory name so the results would look like this:
C:F1BackupadministratorCData
C:F1BackupadministratorCDataDeploy
C:F1BackupadministratorCDataDeploy


Also, is there a way to just get the file names so the results would look like this:
kit.zip__--1-07272007124351.F1O
setup.exe__--1-11292007122443.F1O
SMD_FSW.application__--1-11292007122443.F1O

I've seen some examples with Sql server but they use the reverse function which is not available in sql compact.

Any ideas would be greatly appreciated.

View 1 Replies View Related

BCP - File Is Not Getting Created

Nov 5, 2007



Hi all,

I have been trying to extract table data into file but its not getting extracted. I am using following command to run.


exec spGetIPAddress @ip = @servername output


select @SQL = 'bcp '

+ char(34)

+ ' select Field from ['

+ @DatabaseName

+ '].[dbo].Temp_ExtractSR39'

+ ' order by Field'

+ char(34)

+ ' queryout '

+ @RenamePathAndFile

+ ' -T -c -CACP -S'

+ @servername


exec master..xp_cmdshell @SQL, no_output

Is there any setting need to be done at database level? or any setting for Sql server?

Thanks in adavance,
Anshu


View 3 Replies View Related

Output Column Width Not Refected In The Flat File That Is Created Using A Flat File Destination?

May 11, 2006

I am transferring data from an OLEDB source to a Flat File Destination and I want the column width for all of the output columns to 30 (max width amongst the columns selected), but that is not refected in the Fixed Width Flat File that got created. The outputcolumnwidth seems to be the same as the inputcolumnwidth. Is there any other setting that I am possibly missing or is this a possible defect?

Any inputs will be appreciated.

M.Shah

View 3 Replies View Related

Importing All The Text File In A Directory Using DTS

Sep 28, 2005

Hi everyone

Thanks for reading and helping me out of this problem.
I have a directory where I have text file with date as a file name, thus all the files have different file names.

But I want to do is import all the text files into sql server 2000 ,right now i have a DTS package which i have up upload all the text files manually , I do not know how to loap it so that it DTS funcation check all the files in a directory and import it into database.

I will appreciate if anyone can help me out of this .

View 1 Replies View Related

Sql2005 Export File To Directory

Jul 23, 2007

Hi all,
I have scheduled a package to export data from the table to the execl file in the local directory, it work fine. However, when the next time you execute the package it give error on 'file already exists'. Prephap this is due to previously already created a file in the directory.

I try to use drop option in the ssis during creating the package for export, but the result still the same. I do not know the drop option is working, can someone tell me is that working fine? if not what is the solution or possible cause.

Thanks for your help.:)

View 1 Replies View Related

SQL 2012 :: How To Get Name And Timestamp Of File From A Directory

Mar 18, 2015

I want to write a stored procedure or a simple T-SQL snippet that takes a parameter "Directory Path" and gives me the name and datetimestamp associated with each of the files within that directory. I can not use xp_cmdshell since it is not allowed. CLR integration is not enabled on the server either.

Is there any other way at all to achieve this directly from SQL Server using T-SQL?

View 3 Replies View Related

File Not Created From Sp_trace_create

Jun 11, 2006

I am getting a return code of 12 (""File not created"") from sp_trace_create. I have checked to ensure that the path is valid. I am using Windows Authentication and the Windows Administrator account. SQL Server is using the Windows userid that I created for SQL Server. I have verified (at least tried to verify) that the user for SQL Server has access to the folder containing it. The following is the relevant portion of what I am attempting. DECLARE @RC int, @TraceId intExec @RC = sp_trace_create @TraceId OUTPUT, 0, N'C:TraceFile' I have tried other paths that also do not work.

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

Has Anyone Created A Thesaurus File?

Feb 25, 2008



Has anyone created a Thesaurus file that is using it? Specifically, has anyone set up a First Name thesaurus file and is it possible to get a hold of it. Why reinvent the wheel if someone has already done this. I am creating a database that needs to return records for fuzzy matches on first names. I don't know what all forms of the names can be such as Robert, Bob, Bobby, Bert or Sue, Suzie, Susie, Susan, Suzanne, etc. and I am betting someone has created something already that can be a starting point at least.


What about the Thesaurus Word currently uses? Does anyone know what the physical file name and location is of the thesaurus file Word uses?

Any help or direction is appreciated.

Thanks

Paul

View 1 Replies View Related

How To Retrieve Most Recent File From Local Directory?

May 30, 2007

Hi,



Here's my situation. Every day I will be downloading extracts to a folder. The extracts are named:



20070529.Extract1.csv

20070528.Extract1.csv

20070527.Extract1.csv

20070529.Extract2.csv

20070528.Extract2.csv

20070527.Extract2.csv



So, on any given day, I will want to find the most recent versions of Extract1 and Extract2, for example:

20070529.Extract1.csv & 20070529.Extract2.csv



How would I go about doing this?



Thanks much

View 12 Replies View Related

Create Directory With A File System Task

Sep 13, 2006

Hi!

I'm having a bit of a problem implementing a File System Task to Create a directory and would appreciate some help if possible.

I want to create a date directory so I can move files to once they are imported successfully. The date portion for the directory comes from the import file whose name is variable and in the format of PerfLog_<yyyymmdd>.aud. So, in essence, if I am processing a file named Perflog_20060913.aud, when I am done processing it I want to create a directory c:myprog20060913 and move my processed file there.

Can anyone help me? Please.

View 7 Replies View Related

HOW TO FIND BACKUP FILE IN DEFAULT DIRECTORY

Dec 17, 2007



I am getting a backup file in default directory by using this script







Code Block
BACKUP DATABASE CPHONE
TO DISK = 'CPHONE.Bak' -- send to default pathaway
WITH FORMAT,
NAME = 'Full Backup of CPHONE'






Is there any way to find where is the default path of the SQL server, in order to show to the user from a VB program in which pathway the database back up is stored




View 4 Replies View Related

Created .dtsx File How Do I Schedule It?

Mar 27, 2007

How dow you schedule a file(.dtsx)(I think it is a package) that was created in the SQL Server BI Design Studio to run? I can locate the file I created in SQL Server Management Studio and see it in the right hand pane and even edit it. I can run it in the Design Studio, but cant see how to do that in Management Studio nor how to schedule it.


This is my first attempt at recreating a DTS package using SQL Server tools instead of the Legacy conversion wizard, and I think my brain has overheated. I just cant find it on the Management Screen or the Design. I am also not searching correctly anymore on books online because I cannot find it.



Thanks for pointing me to where I need to go or do.


Tracey


View 5 Replies View Related

Mobile Sdf File Created On Server

Aug 15, 2007

Hi there,

Background: I've created an application to run on windows mobile 5.0 devices. It replicates to a publication on a server. To do this it goes through ASP.net. This creates the database on the Mobile Devices.

Issue: Problem is the initial download of the database is taking 2hours plus to replicate (create) for the first time. So I'm trying to create the .sdf file on the server, zip it, and send it across to the handheld. All subsequent replications take about 5 minutes.

Question: Does anyone know how, or have examples for creating a Mobile CE database on the server. I need to create it using ASP.net and go through a pre-existing publication where a hostname used for filtering.


http://msdn2.microsoft.com/en-us/library/ms173009.aspx explains how to create this in SQL Server Management Stuidio. How do you do the same thing over ASP?

Can this be done using SMO? How do you create a SQLServerCompactEdition database using normal .NET Framework? Thanks for your help!!

View 5 Replies View Related

How Do I List Contents Of File Directory In The SQL Query Analyzer

Apr 13, 2006

how do I list contents of file directory in the SQL Query Analyzer

View 1 Replies View Related

Stored Procedure - Create Trigger File In Particular Directory

Oct 26, 2012

I created stored procedure to create trigger file in a particular directory using xp_cmdshell.

I am calling the procedure from windows batch script as follows

@@set osq200=osql /a 4096 /b /E /e /d %dbn% /m-1 /r 0 /S %dbs% /Q "exec SP_Create_TriggerFile %2,%1 "
@%osq200% >>%3rec.txt 2>%3rec_err.txt
@set dberr=%errorlevel%
@if %dberr% GTR 0 goto createDATriggerFileErr >>%3rec.txt

If the directory doesn't exist, its throwing error "The system cannot find the path specified" , but the %errorlevel% still showing as 0..

View 1 Replies View Related

SQL 2012 :: Converting Directory File Path Into HierarchyID

Jul 22, 2014

I am trying to create hierarchyID for a directory file path.

View 1 Replies View Related

SQL 2012 :: Query To Get File Name And Date Modified From A Directory?

Sep 3, 2014

basically what we need is a query that will allow me to provide a directory and a variable for number of days for instance 1 day old and I want to be able to able to delete all files older than that date and of course I want to be able exclude files of a particular type where I would give it a wild card statement for example say i wanted to save all csv files i would have the wild card say <> '%.csv'

View 3 Replies View Related

File System Task - How To Move Directory Contents

Jul 13, 2006



Hi,

I want to move all files of one directory/folder into another usng SSIS, like in DOS Prompt we use the command,

Move d:ftpSource*.* d:ETLSource

I have tried by creating a file system task, but there is no option for Move Directory Contents. Move File is not accepting wild cards.

Regards,

Imran.





View 3 Replies View Related

File System Task -Delete Directory Content

Jul 25, 2007

This delete's the directory content as well as sub directory content! Is their a way i can just set it to delete the files in the said directory and not sub directories?

View 11 Replies View Related

Ms Sql Mdf Database File Attached Vs Created On Sql Server

May 27, 2007

 Hi allI have a question concerning sql database mdf files. In the old days I would user a ms access database. This file would be stored with the actual web files and would utilise a dsn connection. I have noted when designing with vwd 2005 express it allows you to use 2 methods of creating a mdf database. You can either create it as an attachment mdf or you can create it directly using sql manager. My question is, if you create the mdf database as an attachement file can you store it in the same manner as if you where using a ms access database, meaning can you store it with the web site's files so it uses the file storage allocated size and then create a connection similar to a dsn (but for sql) to the isp's sql engine or does it have to be uploaded to the isp' s sql server.The reason for this question is some of my customers do not want to pay the extra cost to have an sql allocation, however I do not want to go back to using old asp methods to create advanced sites as I prefer using stored procedures. Any help will be appreciated 

View 4 Replies View Related







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