I am not sure if this has been asked before but I couldn't find any thread talking about this.
Let's say we have a parameter in the .sql input file called @Start_Date, how can we pass the value of a particular date, for example, "02-28-2007" to @Start_Date via SQLCMD? is it possible?
I'm trying to skip the need to write a simple windows application...if things can be achieved via dos command line, that will keep everything simple!
I want to pass a command line values into an osql run stored procedure. The commandline values should be are the values to put into the insert stored procedure that writes them to a table.
I have a ForEachLoop parent pkg that reads thru the file system of dtsx to be executed.
I would like to pass CLI parms to the command itself (dtexec). I'm not looking at passing values to the child pkgs but rather additional command line values such as:
/CONFIGFILE "C:myconfig.dtsConfig.
In my expression builder for the PackageName I added the additional string but during the execution, the reference to my dtsconfig is ignored without any errors and the child pkg runs using the default values provided at design time.
I am trying to install SQL Server 2005 Standard and upgrade from Express edition. The Edition Change check tells me I must run the setup from the command prompt "and include the SKUUPGRADE=1 parameter", but I don't know how to enter this from the command line.
I've tried "D:setup SKUUPGRADE=1" and "D:setup -SKUUPGRADE=1", as well as "D:setup.exe /SKUUPGRADE=1" without success.
Can anyone give me a clue as to where I'm going wrong?
I want to run and 'Alter Database' statement from within a batch file.The batch file is to be run from an external automation program,(don't ask why)..I know the syntax for the alter db statement but not sure how to do itin a batch file and also If I have 2 instances how do I run it againsteach instance.All being done on Windows 2000 with Sql 2000.Any ideas will be a help.
I have a package that let me to import data from a excel book to a Sql server data base. When I try to run this package like a step into a SQL server Job it show me the next error.
"The command line parameters are invalid. The step failed."
the "command line" looks like this
/FILE "C:ProjectPackage.dtsx" /CONNECTION ConexionExcel;"Provider=Microsoft.Jet.OLEDB.4.0;Da ta Source=;Extended Properties=""EXCEL 8.0;HDR=YES"";" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EWCDI and in my excel conexion is:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=;Extended Properties="EXCEL 8.0;HDR=YES"; When i run the "Command Line" in the "Command window" the error is more expecific
"EXCEL 8.0;HDR=YES;" is not valid So I chanded the "Command Line" in order to run it in de command window(look the double quote in the excel properties)
/FILE "C:ProjectPackage.dtsx" /CONNECTION ConexionExcel;"Provider=Microsoft.Jet.OLEDB.4.0;Da ta Source=;Extended Properties="EXCEL 8.0;HDR=YES";" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EWCDI then the package RUN, but when i tried to do the same thing in the sql wizzard, it just dont work and it lost the threat from de package and the errors says this time:
Couldn't find the package
Some one who knows the answer or has any idea to helpme please?
I want to use a for each loop container to go through all files listed in a particular folder. Each of those file names must be passed as a parameter to the relog.exe command utility
example:
Folder C: emp Files in C: emp: log1.csv, log2.blg, log3.txt
The relog utility converts the performance counter logs to sql format and pumps it in the database (DSN:PerfCounters)
The idea is that someone drops multiple counter logs in c: emp and you start a SSIS package to pump the data from all the files in the database.
I'm not sure where to start. Do I have to put a Script task inside the For Each loop container en start scripting the commands in Visual Basic.Net or is there a more simpler way to achieve this in SSIS?
i have installed a new sql server 2005 instance. as usual the data and log devices went to standard location. as per my company policy i have to put data and log in different drives..
for eg. k:data j:log
i have move master and other db's device files to new location and i can modify it using configuration manager
but i ahve to do it on many servers so thought if i can do it from command line could save me lot of time ( i can eventually automae whole procedure)
what commands are available to change such paramter.. i need to change startup parameters options -d -l -e
What is the correct command line parameters to SQLEXPR32.exe that will default the Log On As: properties for the instance to use the Built-in account of Local System & Local Service?
I need it to be set to Local System immediately on install without having to go into the configuration manager. When I run the SQLEXPR32.exe right now I get the Network Service defaulted.
Microsoft confirmed that the error message "The command line parameters are invalid" issue mentioned above is a bug and has been resolved in the next "drop" of SQL Server 2005.
has this error been fixed by microsoft. Cos i still get this error!!!!!!!!!
I am also trying to run the package from command line and when i click on execute the package it runs half way and hangs. What could be the problem????.
But when i run it from my Studio and stored package it works fine!!!
I created a SSIS package that has a flat file manager whose connection string is a package variable, the reason is that there is a foreachfile container loop to loop thru CSV format files in a directory and load them to a sql table.
The package execution is working in the designer studio as well as in the management studio-- a copy was saved to a sql 2005 server where a sql job is deployed to run the package. However when I ran the job, it claims successful but doesn€™t do anything in reality. If I checked the box failing the package upon validation warming, the job will fail with the error: the command line parameters are invalid. The command line looks like below:
One thing that I think maybe wrong is on the data source tab of the job step GUI, the flat file manager€™s connection string is blank, compared to other connection managers having related values.
I have a Sql agent job which will exeute a SSIS package. While, one of my data sources is an excel file. I scriptted the sql agent job and recreate on a test server, it fails with The command line parameters are invalid.. The command line has the following for the excel data source, and that is the place fails the job. /CONNECTION UserDataExcel;"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\myserverUserDataUserData.xls;Extended Properties=""EXCEL 8.0;HDR=YES"";" I guess it has something to do with the double-quote inside, Please advise.
I created a SSIS package to import an excel spreadsheet into my data warehouse. When I run the package it runs fine. When I created a SQL Job to run the package I get the following error:
Option "Source=D:HelpDeskImportBook2.xls;Extended" is not valid. The command line parameters are invalid.
Now if I look at my source connection string in the job it looks like the following:
Hi,I have dumped a very large database from mysql (using mysqldump program)as a raw sql file. The reason was, convert this database to a MSSQLdatabase. Since mysqldump creates the file as raw sql file with thedatabase-table structures and the data in it, I thought using OSQL commandline utilities should work to out this whole database in MSSQL server.I have run this command from command line:osql -u sa -i mysqldump.sqlIt is going since yesterday. It has been almost 36 hours that it'sstarted. And in the mssql server, I see no database created yet. On thescreen of the command line, I see bunch of numbers are going in order. Iassume they are row numbers of the tables processed. But, if it is doing it,then where is it saving all this data ? I have checked the tempdb, pub db,other dbs, and I see no tables related to the database I am inserting. Willit populate it at the and of the job ? Or, am I doing something wrong here?Regards.Murtix.
My client will be receiving a .dbf file which needs to be uploadedinto a sql server database table (as an append) every week. They areNOT computer savvy and I would like to automate this process ratherthan go into enterprise manager and run data transformation.Is there any way to write a batch file or a set of command lines whichwill do this?Thanks.Monica
We already used Oracle Datasatage Server the following Query statement for Source and Lookup.here there is parameter maping in the SQl Statement . How can achive in SSIS the Folowing Querystatment?
Query 1: (source View Query) SELECT V_RDP_GOLD_PRICE.GDR_PRODUCT_ID, V_RDP_GOLD_PRICE.ASSET_TYPE, V_RDP_GOLD_PRICE.PREFERENCE_SEQ, V_RDP_GOLD_PRICE.RDP_PRICE_SOURCE, TO_CHAR(V_RDP_GOLD_PRICE.PRICE_DATE_TIME,'YYYY-MM-DD HH24:MI:SS'), TO_CHAR(V_RDP_GOLD_PRICE.REPORT_DATE,'YYYY-MM-DD HH24:MI:SS'), V_RDP_GOLD_PRICE.SOURCE_SYSTEM_ID FROM V_RDP_GOLD_PRICE V_RDP_GOLD_PRICE WHERE REPORT_DATE = (select max(report_date) from V_RDP_GOLD_PRICE where source_system_id = 'RM' )
Query 2: (look up )
SELECT GDR_PRODUCT_ID, TO_CHAR(MAX(PRICE_DATE_TIME),'YYYY-MM-DD HH24:MI:SS') , TO_CHAR(REPORT_DATE,'YYYY-MM-DD HH24:MI:SS') FROM V_RDP_GOLD_PRICE where GDR_PRODUCT_ID = :1 and report_date = TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS') AND PRICE_DATE_TIME BETWEEN TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS') - 7) AND TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS') GROUP BY GDR_PRODUCT_ID, TO_CHAR(REPORT_DATE,'YYYY-MM-DD HH24:MI:SS')
please anyone give the sample control flow and how to pass the parameter?
Can anyone give clues as to why the same copy command works inDOS and not in xp_command shell.I am an admin in both servers andin the database.The results indicate one file is copied but no file is foundat destination.Your input is appreciatedVincentocopy "D:Program FilesMicrosoft SQLServerMSSQLBACKUPQMISDEVack1.txt" "\corp156d$Program FilesMicrosoft SQLServerMSSQLBACKUPQMISDEV"works just fine butusemasterexec xp_cmdshell 'copy "D:Program FilesMicrosoft SQLServerMSSQLBACKUPQMISDEVack1.txt" "\corp156d$Program FilesMicrosoft SQLServerMSSQLBACKUPQMISDEV"'
In SQL Server using xp_cmdshell we can excute any of the command or executable files which can be executed in command prompt. Here my problem is that .. I am trying to execute OSQL from the MSSQL(Query Analyser) using xp_cmdshell.. but its give error saying "'osql' is not recognized as an internal or external command, operable program or batch file." This error occours when it is not able to find the executable file... but same thing I am able to execute from the command prompt. So I feel this problem is some where related to the path setting of windows. If some one can solve this problem or sugesst the how to set the path for window it will be help full.. waiting for reply
I am in the process of writing a stored procedure that takes data from a table, within a cursor, and puts that data to the network server via the xp_cmdshell procedure. The xp_cmdshell command is at the end of the cursor in the SP.
I have worked with the admins on getting the proper permissions to execute this procedure and have tested it by running the procedure directly in Query Analyzer and by calling it in Query Analyzer successfully.
However when I try to call this procedure from another programming envirnoment, once the xp_cmdshell process is called, the procedure locks up and blocks the rest of the process, including the other software programming environment. When I look at the error log, it indicates that correct command, as a matter of fact I have copied the log file command into Query Analyzer and ran the procedure successfully. So for some reason, the statement is not being committed or there is some kind of threading issue I do not know how to address.
If anyone out there has any suggestions or has a simular problem in the past and knows how to address it, it would be greatly appreciated.
Hi, for some AP issue, the file I upload must be without the line feed/carriage return in the last line. for example:
original fixed-length file (exported from SSIS) line NO DATA 1 AA123456 50 60 2 BB123456 30 40 3 CC123456 80 90 4 <-- with line feed/carriage return in the last line
The file format that AP request. The file only has 3 records, so it should end in the third line. line NO DATA 1 AA123456 50 60 2 BB123456 30 40 3 CC123456 80 90
Should I use script component to do it ? I am new for VB . Anyone would help me ?
Hi, I need to send a table data into flat and then ftp into different location. I was using xp_cmdshell via sql task but my network engineer is saying that this xp_cmdshell will break the security and recomond to use "Execute Process Task". If i'm using this task getting the below error. Could you advice me regrding network engineer thought and any solution for avoiding this error.
--------------------------- Execute Process Task: C:WINDOWSsystem32ftp.exe --------------------------- CreateProcessTask 'DTSTask_DTSCreateProcessTask_1': Process returned code 2, which does not match the specified SuccessReturnCode of 0. --------------------------- Thanks,
We connect to the remote database servers through the network from loca by using Query Analyzer. Previously we were able to execute the xp_cmdshell command from local Query Analyzer to fetch the remote databases data. But now we are unable to execute the xp_cmdshell command on remote databases from local Query Analyzer We do not know what happened but i think due to network updates this command is not able to execute...
For ex: Previously i was able to execute master..xp_cmdshell 'net start' from local Query Analyzer.But now not able to execute
Now my question is, is there any other way(Directly or indirectly) to execute the xp_cmdshell command on remote databases from local?
Note : we are able to execute this command on remote Query Analyzer but not from local QA
Using Query Analyzer, I can right click on an object and select "scriptobject to new window as create" and I get the text of the object'sdefinition (schema). Can I get same result from command line, i.e., fromosql, I can get text output for the definition of the object (something likedefncopy under Sybase)? If so, what is the command or store procedure name?Thanks in advance.