Running A SQL File From OSQL Command Line Utility
Jul 20, 2005
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 MSSQL
database. Since mysqldump creates the file as raw sql file with the
database-table structures and the data in it, I thought using OSQL command
line utilities should work to out this whole database in MSSQL server.
I have run this command from command line:
osql -u sa -i mysqldump.sql
It is going since yesterday. It has been almost 36 hours that it's
started. And in the mssql server, I see no database created yet. On the
screen of the command line, I see bunch of numbers are going in order. I
assume 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. Will
it populate it at the and of the job ? Or, am I doing something wrong here
?
Regards.
Murtix.
View 2 Replies
ADVERTISEMENT
Sep 13, 2004
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.
Is it possible to do this.
View 1 Replies
View Related
Apr 23, 2008
Hi,
I need to run a package wich is located on the file system of a PC. The problem is that the PC from where I'm running a bat file to call the package from the other PC where the package is, doesn't have SSIS.
So I was wondering if this will work. I believe that I will have to copy the DTExec.exe file to the PC where my bat file calls to the dtsx in the other PC. I am right?
My run.bat will have this line: \PCshared_folderpackage.dtsx.
Will this work?
Thanks
View 6 Replies
View Related
Aug 29, 2006
how can i create a folder in the integration services-stored packages-MSDB folder using dtutil command line utility.
I could create a folder within a folder inside MSDB using
dtutil /FC SQ; est;temp
but not in the MSDB folder.
Thanks &Regards,
Vivek S
View 1 Replies
View Related
Jan 19, 2008
Reinstalling SQL Express did the trick
Thought this might help others..
View 2 Replies
View Related
Feb 16, 2007
I've exported surface area configuration settings from a server and tried importing them onto another server. The remote connection settings are imported but the SQLBrowser service remains Disabled. Am I doing something wrong?
The command line command I ran (in the C:Program FilesMicrosoft SQL Server90Shared directory) is "sac.exe in sacconfig.xml".
The following is my config file:
<?xml version="1.0" encoding="utf-8"?>
<CommandArguments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Components>
<anyType xsi:type="Component">
<Type>SqlServer</Type>
<InternalType>DatabaseEngine</InternalType>
<Instances>
<anyType xsi:type="Instance">
<Name>SQLEXPRESS</Name>
<Service>
<Name>MSSQL$SQLEXPRESS</Name>
<StartMode>Auto</StartMode>
<ServiceState>Running</ServiceState>
</Service>
<Features>
<anyType xsi:type="Pair">
<Key>AdhocRemoteQueries</Key>
<Value xsi:type="xsd:int">0</Value>
</anyType>
<anyType xsi:type="Pair">
<Key>CLRIntegration</Key>
<Value xsi:type="xsd:int">0</Value>
</anyType>
<anyType xsi:type="Pair">
<Key>DedicatedAdministrator</Key>
<Value xsi:type="xsd:int">0</Value>
</anyType>
<anyType xsi:type="Pair">
<Key>DatabaseMail</Key>
<Value xsi:type="xsd:int">0</Value>
</anyType>
<anyType xsi:type="Pair">
<Key>HTTPAccess</Key>
<Value xsi:type="ArrayOfAnyType" />
</anyType>
<anyType xsi:type="Pair">
<Key>OLEAutomation</Key>
<Value xsi:type="xsd:int">0</Value>
</anyType>
<anyType xsi:type="Pair">
<Key>ServiceBroker</Key>
<Value xsi:type="ArrayOfAnyType" />
</anyType>
<anyType xsi:type="Pair">
<Key>SQLMail</Key>
<Value xsi:type="xsd:int">0</Value>
</anyType>
<anyType xsi:type="Pair">
<Key>WebAssistant</Key>
<Value xsi:type="xsd:int">0</Value>
</anyType>
<anyType xsi:type="Pair">
<Key>XP_cmdshell</Key>
<Value xsi:type="xsd:int">0</Value>
</anyType>
</Features>
<Protocol>
<anyType xsi:type="Pair">
<Key>NamedPipes</Key>
<Value xsi:type="xsd:boolean">true</Value>
</anyType>
<anyType xsi:type="Pair">
<Key>TCPIP</Key>
<Value xsi:type="xsd:boolean">true</Value>
</anyType>
</Protocol>
</anyType>
</Instances>
</anyType>
<anyType xsi:type="Component">
<Type>SqlBrowser</Type>
<InternalType>SqlBrowserService</InternalType>
<Service>
<Name>SQLBrowser</Name>
<StartMode>Auto</StartMode>
<ServiceState>Running</ServiceState>
</Service>
</anyType>
</Components>
<Version>9.0.242.0</Version>
</CommandArguments>
View 1 Replies
View Related
May 4, 2004
Hi all
I currently have a problem where I need to create a backup from MSSQL, via a command line, ideally from a batch script. This is on a PC. Each machine has SQL Server 2000 on.
I just need to know the code that dos will tell it to run the sql statement. Ideally the command will also give the directory to place the backup.
Regards MiloJ
View 2 Replies
View Related
Apr 17, 2007
Hi Everyone!
I'm trying to run have SQL Server Agent excute an SSIS package from the command line and I keep recieving an error message. I will assume that I have miss typed something. Can someone validate that the execute line looks workable?
"C:Program Files (x86)Microsoft SQL Server90DTSBinndtexec.exe" /F "F:ProjectsSSISCustomerMaster_1CustomerMaster_1Package.dtsx" /CONNECTION "APLUS70F70.AKIN";""uid=AKIN;Dsn=APLUS70F70;"" /CONNECTION "CRMPSQL.IBT_Aplus";""Data Source=CRMPSQL;Initial Catalog=IBT_Aplus;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;"" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EW
Thanks in advance!
Anthony Akin
View 10 Replies
View Related
Apr 22, 2000
I need to start a job task from the command line. Does anyone know of the correct command(s) to do this?
I also need to check to see if a specific job task is currently executing from the command line. Does anyone know of the correct command(s) to do this?
Thanks for any assistance.
Jim
View 4 Replies
View Related
Jun 11, 2011
How to launch Oracle SQL Developer through "Run" window in windows as we can launch SQL Server Management studio through "Run" command line using command line "sqlwb -S localhost -d MyDB -U sa -P
View 4 Replies
View Related
Jan 30, 2008
Hi All,
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:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:HelpDeskImportBook2.xls;Extended Properties=HDR=YES;EXCEL 8.0;HDR=YES";
Does anyone know why it appears that my connection string looks like it is being cut off and does anyone know how I can correct the problem?
Thanks,
Scott
View 8 Replies
View Related
Jul 20, 2007
I've written a small dos batch script that runs a simple query throughosql and then calls an exe which sends an email if the returned value
Quote:
View 2 Replies
View Related
Jul 28, 2004
using osql utility i have converted a table in database to excel format. I have also chinese data in my database . The problem is while converting the data into excel format ,the chinese data is not comming in excel sheet.
Does anybody have an idea about this .
For converting i have used
declare @x varchar(300)
set @x = 'osql -S Servername -U username -P passwd -q "select * from northwind..region order by cand_index" -w 3000 -s "," -o C:directoryfilename.csv'
Thanks
View 2 Replies
View Related
Aug 14, 2004
Hi all
I am using osql utility in sql server 2000 to convert data in database to excel sheet. My datas contain both english and chinese . While converting to excel sheet english datas are comming but the datas in chinese is comming like (?) this. Does any body has any idea to solve this problem. is there any way to set font in osql utility.
set @x = 'osql -S servername -U username -P password -q "select * from
northwind..region" -w 3000 -s "," -o C:Downloaddownload.csv'
This is what i have used.
Note: I tried giving chinese font in excel still it is not working.
Its really urgent pls reply
thanks
View 2 Replies
View Related
Oct 13, 2006
I am using the osql utility to access my sql server express edition.
My problem is that i don't know how many database is in the sql server so can any teach me how to list out all the name of the database in the sql server using a sql statment?
Oh, and can anyone teach me how i can attach and detach a database in the sql server using sql statment.
Thanks for the help...
View 3 Replies
View Related
Jul 20, 2005
I need to execute xp_cmdshell in a trigger and pass a command lineparameter to the .exe programi.e. I have a .exe program c:program filessavedata.exeIn the trigger I have a parameter @Id bigintI need to pass the parameter @Id to savedata.exeIn the trigger, I am tryingEXEC master..xp_cmdshell 'cmd.exe /C "c:program filessavedata.exe "'+ CAST(@Id as varchar)BUT this does not work.Can someone please help me with how to do this?Thanks,db
View 1 Replies
View Related
Mar 23, 2007
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!
thanks! :)
View 3 Replies
View Related
Jul 20, 2005
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
View 3 Replies
View Related
Sep 17, 2007
SQL Server Compact 3.5 - I've a sdf file created in a .NET windows desktop command line program. How to now consume the data in MS Excel?
I can see that under
C:Program FilesMicrosoft SQL Server Compact Editionv3.5
I've one DLL called
sqlceoledb35.dll
But I don't have any oledb driver listed when creating an UDL file?
How can I consume the data in other apps that are not .NET and developed in house them?
Thanks, AM.
View 13 Replies
View Related
Jun 14, 2001
Hi All,
How can I run a host command (OS command ) from ".sql" script of sql server?
-- Rajesh
View 2 Replies
View Related
Jun 13, 2008
Does anyone know of a utility that would perform lines of code, comments and blank lines for all SP's in a given database? One of the guys on the development team was telling me that his management team wants this information. Right now they guess-timate these values but I was wondering if anyone knew of a utility to get accurate counts.
Personally I think management is off their rocker but this isn't my battle to worry about :)
View 3 Replies
View Related
Feb 2, 2007
Hi,
I'm running the osql below from a batch file:
%SQLPath%osql -U%DBUser% -P%DBPswd% -S%SQLServer% -d%Gatewaydb% -w256 -b -n; -c -h-1 -iBatchScriptsSQL_Get_Create_Batch1.sql -oZ:mboxmmis835increate_835_1.bat
My output file comes out fine with one exception, there is a blank space at the beginning of each line. Is there a way to remove this ? One suggestion I have seen is to do this with BCP instaed of osql but I don't know if BCP can "run" my "SQL_Get_Create_Batch1.sql" file above. The ".sql" creates a temporary table and then does a select.
Thanks,
J
View 8 Replies
View Related
Dec 1, 2004
Hello All,
A VERY green SQL Server DBA here looking for some help. Our main production environment is Oracle, which utilizes Control-M as a scheduler. At the end of the Oracle batch process, we would like to automate a process to kick off a sql server job (perhaps via osql??) Is this possible?
Thanks in advance,
Tony
View 14 Replies
View Related
Feb 25, 2004
Hi,
When i want to run the OSQL utility, it will open the command prompt, but only for about a second, then, gone...
I'm running an XP pro machine with MSDE 2000 installed locally... any ieads??
thanks!
View 2 Replies
View Related
Dec 7, 2000
Can anyone tell me how to enable bcp utility. Because anytime I try to run BCP I get the following error messages: (BCP not enable). Also how can I get to SQL Server command prompt? I look forward to hearing from anyone.
View 2 Replies
View Related
Aug 8, 2006
Hi,
How do I execute all the .sql scripts in a folder with OSQL command?
Thanks in advance,
Hari Haran Arulmozhi
View 4 Replies
View Related
Jun 10, 2002
Hi everyone,
I have created a DTS package in SQL Server 2000 which is running good when I execute it through SQL Enterprise manager.
But when I try to run the package through command line DTSRUN utility on server, I am getting the following error message displayed.
"DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259 (80004005)
Error string: Error opening datafile: There are currently no logon servers available to service the logon request.
Error source: Microsoft Data Transformation Services Flat File Rowset Provider
Help file: DTSFFile.hlp
Help context: 0
".
The same package is getting executed properly when I run it from my client through DTSRUN from the command prompt.
Any idea if it is because of security issues.
thanx in advance.
Mad
View 4 Replies
View Related
Apr 23, 2008
I am presently using 'tablediff' utility of SQLServer 2005 to compare tables located on two different servers. My real intension is to backup data from Serv1 to Serv2, except that I wish to update the tables on server2 with only newly inserted rows and updated rows and NOT deleted rows.
In short, I want the final .sql file generated by the tablediff utility to contain only 'Insert' and 'Update' statements and NOT 'Delete' statements.
I hope someone can help me in this regard.
Thank you,
Little_Birdie.
View 6 Replies
View Related
Jul 20, 2005
I am running the following OSQL command and capturing the return codefor the error .Whenver i have an error like server not exists or uableto login I get a return code of 1 for the %ERRORLEVEL%.Howeverwhenever I have an errorof a wrong dbcompatibility error the retuncode id 1 even though sql returns an iformation message from OSQL thatthe right copatibilty levels are 60,70 and 80.How can i get OSQL toreturn the right return code whenver a error of this type occurrs frombatch mode sql.The OSQL i am running from the batch isosql -S%SrvName% -U%Username% -P%Userpswd% -n -w 132 -d%DBname%-Q%sqlcmd% -o%Dirrpt%\%DBname%_%SPname%.txtECHO %errorlevel% >> %logbatch%IF %ERRORLEVEL% NEQ 0 Goto SQLErrorsqlcms is exec sp_dbcompatibiltylevel srvrname, dbname 80Thanks in anticipation.Ajay
View 3 Replies
View Related
May 5, 2008
Hi all,
I m getting the following error while running the bcp utility.
Cannot insert null into column_name in table
something like this.
The value for that column is null in the input .csv file.
Instead of throwing error like this, i need those bad records should go in to the .BAD file and the remaining records should get uploaded into the database.
In my case the entire data upload is failing if any one bad record is there in the .csv file.
Can anybody help me. Its a bit urgent.
Thanks in advance,
Bharanidharan L
View 2 Replies
View Related
Mar 20, 2003
I am unable to execute DTS packages,ISQLs when scheduled from SQL Server Agent . It dispalys a Dr.Watson Access Voilation message on the box .The result of the job is "failed as the step did not return any result ".
1)The utilities run fine when run from clients from other computers .
2)They fail again when run thru the command prompt of the box .
3)They suceed when run via the xp_cmdshell .
Can anybody help me out ?
Thanks,
Venkat
View 7 Replies
View Related
Oct 7, 2004
I have a process that is running on the os. This process is picking up FTP files every 5 min, it renames them so not to confuse them with the new files, copies all renamed files into one file to be used by bulk insert, runs the bulk insert to populate a table, and then runs the stored procedure that scrubbing the data and insert it into another table. For every transaction that I do in my stored procedure, I do the error checking as follows:
IF @@error <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN
If my stored procedure encounters an error, return statement will stop it from running. If this happens, I need to stop the process that is running on the os as well.
Questions:
How can that be accomplished?
How to restart the stored procedure ones the error has been corrected?
Thank you for your help.
View 3 Replies
View Related
Sep 1, 2006
Hello
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 following lines must be executed:
c:
elog.exe c: emplog1.csv -f SQL -o "SQL:PerfCounters!PerfCounters"
c:
elog.exe c: emplog2.blg -f SQL -o "SQL:PerfCounters!PerfCounters"
c:
elog.exe c: emplog3.txt -f SQL -o "SQL:PerfCounters!PerfCounters"
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?
Many thanks!
Worf
View 3 Replies
View Related