Running Transac SQL In Command Line
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
ADVERTISEMENT
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
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 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.
View 2 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 23, 2005
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.
View 2 Replies
View Related
Apr 2, 2008
Is there any command line that I can use to do select from databases (SQL 2005)
View 4 Replies
View Related
May 1, 2001
hi I would appreciate if someone demonstrate how to automate ftp in a command line from within a batch file. I do want to move certain files from one server to another via ftp command line in an automatic fashion via running the batch periodically.
thanks
Ali
View 1 Replies
View Related
Jun 13, 2000
hi: I can't seem to run BCP thru the command line.
bcp pubs..authors out c:authors.txt -c -Usa -P
error:
Msg 170, Level 15, State 1, Server Y47SA, Procedure , Line 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near'.'.
I've been trying to run BCP thru command line all day. I tried OSQL, ISQL. I find this utility very
frustrating. btw - I have installed SP2.
any thoughts would be much appreciated.
TIA
deanna
View 5 Replies
View Related
Sep 25, 2002
Anyone know where I can find some command line tools such as RCMD etc.. Thank you.;)
View 1 Replies
View Related
Sep 22, 2005
I'm trying to insert into a table 2 values one of which is an
exec master..xp_cmdshell @command where I have assigned @command with a value
this statement gives me the result into a 1 col. table fine:
insert into mytable99(col1) exec master..xp_cmdshell @command
now what I want to do is put col2 in there as well!!
ie. insert into mytable99(col1,col2) values (exec master..xp_cmdshell @command, '123')
I get a sytax error ... on the exec ??
Could anyone help re the proper way of doing this ... thanks in advance
View 1 Replies
View Related
Oct 13, 2005
I use a similar command below to insert into a temp table the result of a large command line call to an exectable with many parameters passed in the command of which the result passed back contains many items. I then parse the response string to get my results...
set @command = 'dir'
insert into tsverisign(response) exec master..xp_cmdshell @command
My question is our can I insert two values at the same time to this same table one of which is my "exec master..xp_cmdshell @command"
similar to insert into tables (field_a, feild_b) values ('1','2')
Something like (and I know this does not work):
insert into tsverisign(response,trans_id)
values (exec master..xp_cmdshell @command, '123')
Any help would be greatly appreciated .... PS I'm new to MS SQL 2000 and proper syntax etc. etc. so I need full example so I can try. :rolleyes:
View 1 Replies
View Related
Jun 11, 2007
Hi All,
I was given a task of coming up with the script to recreate an existing database using a command line. I would use this script in case when the server is down and I can't get to Query Analyzer or EM to recreate it. I am not sure where to start. Any ideas are greatly appreciated.
Thanks.
View 5 Replies
View Related
May 21, 2004
What ius the synthax to backup an SQLServer DB from the command line ?
Thanks
View 1 Replies
View Related
Jan 29, 2008
Can someone give me the command to restart SQL?
Thanks
View 1 Replies
View Related
Jul 23, 2005
I want to restore a backup copy of a database from the command line. Canthis be done?Thanks, Tom.
View 2 Replies
View Related
Jul 20, 2005
Hi Sir:Is any possible to run DTS package from Command Line ?Lucas
View 1 Replies
View Related
May 4, 2007
I am trying to create an quiet install for SQL Server Express. The install is being run under a local administrators account. However, when a user, who is only in the local users group, accesses the application using ClickOnce deplolyment, it says SQL Server Express Edition is not installed.
-Dan
View 1 Replies
View Related
Mar 14, 2007
Hello,
How can I set SQL Profiler to capture the logs via command line?
This is what I have:
I already have a SQL Profiler Template (fooTemplate.tdf) which tells what I need SQL to capture.
C:>"C:Program FilesMicrosoft SQL Server90ToolsBinnPROFILER90.EXE" /Sfoo /Dfoo /E /T"c:fooTemplate.tdf" /Oc:mysql.out
What other parameters am I missing?
Thanks!
J
View 3 Replies
View Related
Apr 22, 2008
Hi all,
A quick newbie question...
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?
Thanks in advance.
Slammin!
View 3 Replies
View Related
Mar 29, 2007
Hello everyone!
Bit of a problem executing a DTS command from a command line.
I have the following variables defined in my package:
UserVarchar1
UserVarchar2
UserVarchar3
All have a scope of Package, all of the mstrings
The command I'm attempting to run in 1 line is:
DTEXEC /FILE "C:SSIS PackagesED-CustomersPackage.dtsx"
/SET Package.Variables[User::UserVarchar1].value;"10"
/SET Package.Variables[User::UserVarchar2].value;"30719"
/SET Package.Variables[User::UserVarchar3].value;"BILLTO"
Description: The package path referenced an object that cannot be found: "Package.Variables[User::UserVarchar1].value". This occurs when an attempt is made to resolve a package path to an object that cannot be found.
DTExec: Could not set Package.Variables[User::UserVarchar1].value value to 10.
Any idea why?
Thanks for the help!
View 10 Replies
View Related
Jul 10, 2002
Hey Folks,
I have inherited a project from a co-worker who has had a family tradegy, and I am trying to get up to speed with her project.
We have an SQL server 7 database which is getting backed up every night (by SQL itself) into a .BAK file. I need to know if it is possible to restore this file from the command line (a DOS prompt.) I know (or think I know) how to do it from within SQL Enterprise Manager, however the specific needs of this project require it be done from a command line on the machine.
I really am not an SQL guru...I don't even think I qualify as "knowing what I am doing" at all, so any advice you can offer will be greatly appreciated. This is kind og urgent, so your thoughts are welcome!
Thanks!
Mike
View 1 Replies
View Related
Jun 26, 2000
Does any know of a technique to filter out headers dashes and row count in an output file of an isql result? These switches seem to be available when running as isql/w, but not the command line. The -h-1 argument for no headers had no effect. Thanks in advance. Ron Hurley
View 1 Replies
View Related
May 5, 2000
Does anyone know how to start sqlserver 7.0 from command line for windows 98?
Thanks
View 1 Replies
View Related
Oct 31, 2002
I'm trying to use the rcmd utility and when i try to connect to a server with it i get this error...
system not found or service not active? How do you activate the rcmd service? thanks for your help.
View 7 Replies
View Related
Mar 7, 2002
hello to all, and I hope you can help.
this is the code from BOL
dtsrun /Sserver_name /Uuser_nrame /Ppassword /Npackage_name /Mpackage_password /Rrepository_name
I have followed it and come up with ...
dtsrun /SPC-409 /Usa /Pmypassword /Nemployee_export /M? /R?
where can I know the repository_name, is it one of the following:
DTS package
Meta data service package
Meta data
all under Data Transformation Service folder in SQL Server
Thanks
Al
View 2 Replies
View Related
May 21, 2002
Hi all,
Are there any parameters for the SQLMANGR program???
I need to start it from the install script, and
have it autostart....
I found a single parameter /n that starts
the program without any display -
But I need it to autostart the server service itself,
so i can do some osql stuff after the installtion is completed.
thanks
tony
View 1 Replies
View Related
Mar 9, 2007
i have to print Go statement in new line through isql command
my isql command is
isql /Q -SServername -dDatabasename -Usa -PPassword -h-1 -n -q "set nocount on Select ' grant execute on ' + name + ' to user go ' from sysobjects where type = 'U' and name not like 'dt%'" -o SFGRants.sql >> Deploy.log
and out is like
select grant execute tablename to user go
but i want in different format like
select grant execute tablename to user
go
like that
thanking in anticipation
View 1 Replies
View Related
Mar 26, 2015
I want to import a huge .csv file in my sql server database.
There are about 10000 rows and 30 columns
My file looks like this:
Attributname1; Attributname2; Attributname3; ...
data; data; data;...
data; data; data;...
data; data; data;...
Now my idea is to do this on the command line/batch script. I have found different ways to do this job but the problem is i have to create a table in the database first. The entries in the first line of the csv file are the attribute names.
After creating the table with attributes i must write the data in the database.
View 1 Replies
View Related
Oct 30, 2007
Hi,
I am executing a package using command line. I want to display messages on the console while the package execute. Which component will I use?
thanks.
View 6 Replies
View Related
Jul 23, 2005
Hello,I would like to know whether it is possible to execute DTS(Data Transformation Services) packages created from withinthe EM (Enterprise Manager) user interface, from the commandline. That is, is it possible to execute a command at the DOSprompt which will execute, and optionally also reconfigure,the DTS package? This would allow invoking DTS packagesfrom within scripts.Thank you for your replies,Neil
View 2 Replies
View Related
Jul 20, 2005
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.
View 1 Replies
View Related