Commandline Utility
Feb 25, 2008
Hi Friedns
How can i wil go command line Utility in SSIS Packages any command is there plz help me
Hi Friedns
How can i wil go command line Utility in SSIS Packages any command is there plz help me
Hi,
I am trying to run sql scripts from Commandline, i am getting the error "the database doesnot exist use sp_helpdb to show available databases".
I am running this sql query to create database table, appreciate your help.
Thanks
So, I read this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=416220&SiteID=1, which suggested that I could call SQLEXPR32.EXE (the SP2 download) with the relevant commandline args in exactly the same way I could call setup.exe. Namely, if I were to call:
Code Snippetsetup.exe /qb /settings "c:/setup.ini"
then I should be able to use
Code SnippetSQLEXPR32.exe /qb /settings "c:/setup.ini"
where my setup.ini contains
Code Snippet[Options]
ADDLOCAL=SQL_Data_Files,SQL_Replication,Connectivity
INSTANCENAME=AuctionI
SAPWD=auctioni_000
SECURITYMODE=SQL
However, this doesn't seem to be working at all - the commandline params to SQLEXPR32.EXE are completely ignored, and it runs as if they were not specified.
Would be great to get some help on this. I'm equally happy with the set of commands I need to call in order to extract SQLEXPR32 and then run setup, but SQLEXPR32 seems to extract to a random GUID dir, and automatically start setup, neither of which is condusive to automating it.
Thanks,
Dan
SQLCMD works in the Studio if SQLCMD Mode option is chosen.
OSQL and SQLCMD does not work from commandline and produces this constant burnt in message.
Sqlcmd:Error:Microsoft SQL Native Client:Login timeout expired.
Cleint and Server have the same set of protocols
Studio has been added to the list of those permitted by Firewall
Tried to connect through tcp, lpc
Remote has been enabled.
SQLNativeClient does not have a property or method by name 'timeout'.
Let me know if something else is needed?
I'm currently developing a number of SQL scripts to handle a major upgrade of our database from a development server to a production server using Osql.
Everything is working fine, but I have each of the scripts generating text-output and am hoping someone may know how to suppress some the Caution text (specifically triggered when a column has been renamed).
Can anyone provide a possible solution? (there's so many notes being written to the console its easy to miss the errors I'm concerned about.
Thanks!
Ted
I'm trying to install SQL Express Advanced Services from the commandline, but cannot get Management tools to install.
Does anyone know the correct commandline to get this to work?
thanks,
Daren
stupid question time...
how do i add a password (ie, what is the exact wording) to the CommandLine in a SQL Agent Job that is running an SSIS package from the File System, pls?
Here is the CommandLine as I currently have it:
/FILE "\dbase01c$SSISPackageDeployment vrscanus_process_uploadscanus_process_upload.dtsx" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E
I have tried /PWD and /pwd and /PASSWORD already. For these, SQL Job says they are not valid commandLine parameters.
thanks/spirits,
seth j hersh
Hello All,
I've searched high and low for documentation on this to no avail.
Basically my goal is to create a maintenance plan in SQLSERVER2005 via the command line. I need to create this plan in a way that it can be seen in the list of Maintenance Plans in the Management Studio Interface. I went into the SSIS designer and created my plan. I now have a DTSX file. I tried the dtutil.exe utility, however i never saw my maintenance plan in the list of plans.
I ran dtutil.exe and did /FILE to /SQL but i don't see the plan listed or in a way a user could modify it, which is of the utmost importance to my clients.
How do i get my file to turn into a real running Maintenance Plan that is seen in the list of Maintenance Plans via the Management Studio Interface and is editable by clients?
Other things to keep in mind, i'm attempting to create these via Installshield MSI installer. So i need to do it via command line, or file system-wise. No interface or user interaction.
Please Advise.
Hi,
In the BOL article on dtexec it states in the section on the /Reporting option:
The optional parameter event_guid_or_name is a list of exceptions to the log providers
What is an event GUID?
Thanks
jamie
[Microsoft follow-up]
Hi ,
we have a requirement to create a database of our application in client's system. and we assume that already MS Sql server is installed.
we have a .mdf file of our database. Is there any way I can attach .mdf file to the database using command line. so that I can write a batch file and run that batch to create the database in our client's system.
-regards
GRK
I want to create a commandline action. It is my understanding that commandline actions can only be created using ASSL. I cannot find the details required to build the xmla. My ultimate goal is to be able to open a file from a unc path via a cube action.
Using a URL action will not work since the path does not start with http or https. Prepending 'file:' to the unc, with however many hashes you like, does not work with the URL action either. I am hoping I can pass the unc to the commandline and render the file. In any case, it looks like the information needed to create a commandline action is not currently available.
I have a sql sever 2005 express edition database but when i run my backup command from the command prompt, i get this error message .
The .Net SqlClient Data Provider has received a severity 16, state 11 error number 911 on line 1 of procedure on server KSS15SQLEXPRESS: Could not locate entry in sysdatabases for database 'DATABASE1'. No entry found with that name. Make sure that the name is entered correctly. The .Net SqlClient Data Provider has received a severity 16, state 1 error number 3013 on line 1 of procedure on server KSS15SQLEXPRESS: BACKUP DATABASE is terminating abnormally.
DATABASE one is the name of the database i want to backup. Now it looks there so many databases some of which i have no idea where they are. It looks like there some system stored procedures i have to run first before my database file can be located by my commands. It would be wonderfull if some one pointed me to an article that covers this initial part thoroughly.
Hello ,
I want to know how can i can use the bcp coomand to import a text file into a SQL database table . The text file contains info. like servername , date , time , logininfo and description .
The problem is i cannot import that file into the table through data import wizard . The wizard is not able to separate the fields properly and the import takes place with mixed up data in different columns . The separator in the text file is colon . I even tried fixed length with manual column separation .
The text in the text file are not aligned properly as these are log files generated by the system which i am trying to import in a table .
So how can use the bcp command to specify the column length properly and seperate the fields uniformly so that the data gets imported neatly .
Any thoughts how could the command look like ?
Thank you very much .
Anita.
Hi,
I used bcp utility to import and export data between databases. These exported data is it read only? If so how can I change the parameter so that we could edit as well.
Any suggestions will be helpful. Thank you!
I'm trying to use the bcp command to bcp out a single table in a database, what is the best way to do this in the query analyzer? Thanks in advance.
View 1 Replies View RelatedHi all,
I want to use the BCP utility to import data from a .dat file into my database. The .dat file contains a table called xv_Appointments containing the following fields:
AppointmentKey
SurgerySlotKey
PatientKey
Cancelled
Continuation
Deleted
TimeArrived
I would like to import only two of these fields into a table called tbl_Appointments e.g.
AppointmentKey
TimeArrived
I can't seem to get the BCP util to do this. It only works if I import all of the fields from xv_Appointments. Does anyone know if this is possible?
Thanks
In the process of exporting data from SQL data file to text file through BCP utility I am not getting the Column names.How can I get the column names through BCP utility?
I used this script
exec master..xp_cmdShell 'bcp "select * from regulator.dbo.TEMPTBLBRANCHNOTUPLOAD" QueryOUT \indiadbftprootCLIENT_BRANCH_UPLOADranchnotup loaded.csv -S indiadb -U sa -P sasocrates -k -r -c -t "," -q'
Hello,
I am using the DTS utility available with Enterprise Manager in MSSQL server 2000. I can transfer the tables and views without any issues but when i try to transfer the stored procedures it always gives an error. I have tried transferring individual objects too but it does'nt works. The error given is "the user <username> cannot perform the following action". Any help is appreciated.
Thanks in Advance
Hello, I need to create a stored procedure that creates a csv file. this is the code I have so far.
Script is like
CREATE PROCEDURE dbo.GetQuestionInfoCSV AS
BEGIN
declare @sql varchar(8000)
SET @sql = 'bcp "SELECT * FROM dbo.ISO_table" queryout C:GetCSV.CSV -c -t, -T -S MANCHESTSQLEXPRESS'
print @sql
EXEC master..xp_cmdshell @sql
END
and I get these errors on execution
SQLState = 42S02, NativeError = 208
Error = [Microsoft][SQL Native Client][SQL Server]Invalid object name 'dbo.ISO_table'.
SQLState = 42000, NativeError = 8180
Error = [Microsoft][SQL Native Client][SQL Server]Statement(s) could not be prepared.
NULL
Any help would much appreciated.
Greetings,Just wanted to know if there is any parameter in BCPutility that can ignore triggers, indexes and constraint defined for atable?any help will be greatly appreciatedTIA
View 2 Replies View RelatedI'm using SQL 2005 to export data. I would like to use the bcp utilityto export data to an Excel file.I have to generate quite a few files and the names are dynamic. Theideal would be to loop through records in a stored procedure to createa file name to use in the bcp. My question is how can I use the bcpfrom a stored procedure? I know how to run it from the command prompt.Is there a way to control the command prompt from a stored procedure?Thanks all
View 2 Replies View RelatedHello everyone,
I have a question about dtsrun hoping someone have an answer. Does anyone know if there is a switch that I can turn onoff so that it will suppress the output result when I execute the dtsrun ulitity?
This is what I ran:
master..xp_cmdshell 'dtsrun /Sclancy /E /N ExpDispute'
I get the following result back after it's done:
output
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DTSRun: Loading...DTSRun:Executing...DTSRun OnStart: Copy Data from Results to [Transplus_TestArchive].[dbo].[SG_DISPUTE] Step DTSRun OnProcess: Copy Data
from Results to [Transplus_TestArchive].[dbo].[SG_DISPUTE] Step; 14 Rows have been transformed or copied.; PercentComplete = 0; ProgressCount = 14 DTSRun OnFinish: Copy Data from Results to [Transplus_TestArchive].[dbo].[SG_DISPUTE] Step DTSRun:
Package execution complete.
(6 row(s) affected)
Thank you in advance for any help.
Mai Nguyen
Hello All!
I would like to have the SQL server to mail me the alert to my email account.
The mail server is not in our domain.
So how would I set this up so that the alert can be emailed.
Thanks in advance for ur help.
Venkat
I am currently in the process of transfering data from an existing SQL 6.5 server to new box. Both boxes have SQL 6.5 with SP4. I having a problem with a paticular database transfer. The Database/Object transfer utility starts and then about 20% in it says that it is complete. The transfer creates all the objects in the new server but does not transfer the data. I have manually transferred the data but I am curious if anyone else has had this problem or if this is a known bug. Just curious. Thanks
View 2 Replies View RelatedHi,
All the wanted to know whether the ISQL utility is optional during the sqlserver setup??? Is it possible to install sql server without installing ISQL utility??
Thanks in advance,
Asha
hi....
ok...all i want to do is take a global variable and pass it to another procedure using a wrapper... what am i missing...
if i call the 2nd procedure from the first it works fine.... but if i use the wrapper to call both procedures...and yes before you ask i am calling the first procedure that creates the variable before the second which uses it...
it doesn't see it... says it has no value...what am i missing.. please help...
kim
I am trying to do BCP from a comma separator .txt file to upload it into two tables. That is I want the first row (4 columns of header details ) into one table and from the second row (21 columns each of detail rows) to be uploaded into another table. I have written a batch file to upload the header details by giving the first and last column as 1.It is working fine. But when I try to upload the detail rows into another table by giving the first row as 2, the bcp is not able to read from the second row. It skips the second row and reads from the third row. This happens for all separators like pipeline separators also.So to avoid this I have to give blank 21 separators(i.e. , or |) in the second row to avoid the loss of data. Please provide a solution for this, as I cannot insist my customer to provide me a text file with blank comma in the second row.
Thanks and Regards,
S.Raghuraman
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
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
The following webpage desribes the rs utility:-
http://msdn2.microsoft.com/en-us/library/ms162839.aspx
And it says that rs supports the optional parameter, -ltimeout
Can someone tell me what this timeout does/means?
We are passing in a VB.NET script file that reads an XML file that executes a series of reports. Does the timeout apply to the whole VB.NET script file, or to the individual execution of each report?
Can you also tell me, what happens if it times-out? Does SQL Server kill the SQL job generating the report? Or does it just disconnect the client from the server leaving the job to continue generating the report?
Thanks
Hi guys,
I'm trying to use the bcp utility to transfer data from an SQL Server table (CUSTOMERS) to a text file (test.txt).
Here is what I have:
DECLARE @FileName varchar(50)
SET @FileName = 'C: est.txt'
EXEC bcp BAirwaysDB..CUSTOMERS out @FileName -S<servername> -T
only I keep getting the error:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near '.'.
and when running:
bcp BAirwaysDB..CUSTOMERS out C: est.txt -S<servername> -T
on the command line I get:
SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Native Client][SQL Server]Login failed for user 'RIVERAMelanie'.
SQLState = 42000, NativeError = 4060
Error = [Microsoft][SQL Native Client][SQL Server]Cannot open database "BAirways" requested by the login. The login failed.
Can you see where I'm going wrong with this? Any feedback would be really appreciated.
Thank you
Butterfly82
I have been successful at setting up three or four DTS packages to runusing the DTSrun command line utility and the Windows scheduler untilnow. The latest package gives me the following error no matter what Itry.Error: -2147217355 (80041035); Provider Error: 0 (0)Error string: General error -2147217355 (80041035).Error source: Microsoft Data Transformation Services (DTS) PackageHelp file: sqldts80.hlpHelp context: 705I googled the error but got only two hits, only one of which actuallydiscussed the error. That one talked about the security and ID contextof the system agent but I can't even run the package from the commandline, never mind using the Windows chron. The DTS command line I'musing looks like this:DTSRun /S MyServerInstance /R DBName /N MyDTSPacakgeName /EVariations included /U MyUserName /P MyPassWord and a couple others.Next step would have been to use /!Y and /!C to create an encoded batchfile to use for the Windows scheduler.Any help would be most appreciated.Randy
View 4 Replies View RelatedI'm getting some errors when I run rs.exe from command line with regard to Parameters, and was hoping I might get some help here. I'm somewhat new to RS. I'm running SQL 2000 and RS 2000 on a Windows 2003 Server.
Here is my script:
***********************************************************
' File: RunReport.rss
Dim format as string = "Excel"
Dim fileName as String = "C:Export2.xls"
Dim reportPath as String = "/APSAgentCourseCompletionByUserGroup"
Public Sub Main()
' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string
Dim mimeType as string = "ms-excel"
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
' Report Parameters
Dim parameters(5) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "User Group"
parameters(0).Value = "66179312-f341-4df7-a855-79c5b8abaf9f"
parameters(1) = New ParameterValue()
parameters(1).Name = "Start Date"
parameters(1).Value = "12/22/2006"
parameters(2) = New ParameterValue()
parameters(2).Name = "End Date"
parameters(2).Value = "2/17/2007"
parameters(3) = New ParameterValue()
parameters(3).Name = "Course Name"
parameters(3).Value = "AA2B1AA0-E78A-4F84-834F-8EAAB75BEBD3"
parameters(4) = New ParameterValue()
parameters(4).Name = "Status To Include"
parameters(4).Value = "0"
results = rs.Render(reportPath, format, _
Nothing, Nothing, parameters, _
Nothing, Nothing, encoding, mimeType, _
reportHistoryParameters, warnings, streamIDs)
' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()
End Sub
'End of script
***********************************************************
As you can see, right now I've got all 5 report parameters hard-coded.
Here is the command line that I'm using as well as the error that I receive:
rs.exe -i c:RunReport.rss -s http://localhost/reportserver -t
Unhandled exception: The value of parameter 'Parameters' is not valid. Check the documentation for information about valid values.
Any insight that anyone can provide is greatly appreciated.
Thanks!
Ray