.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Post New Web Links

running multiple sp through osql cmd from batch file

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :
 

how to run multiple sp from batch file through osql command and for loop.?

 

i tired this command from batch file

i have created a batch file for example say 5 ctored procedures.when i execute it showing errors whereever needed and for the command executed successfully it shows only numbers like this

1>2>3>4>1>2>3>1>2><4<3<2<1<3<2>1

 

how to turn off this numbers  is there any option?

and my code is beloe

@echo off

OSQL -U() -P() -S() -d() -i c:\SQLQuery2.sql -o c:\execsql.txt

and how topass parameters to the switches like u,p?




View Complete Post


More Related Resource Links

Need help running sql as batch file that creates a list of borrowers

  

Our application database was recently upgraded from mssql server 2000 to 2008.  I am unable to get a batch file that creates a list of updated
borrowers to run.  It was running fine on Windows server 2000 (even after the upgrade to mssql 2008), but I
recently wiped that old server and installed windows server 2003.  The
drive that the file lives on changed, so I changed the name in the
file, but it will not run.  When I try to run it from a command prompt
I get the error:

'melcat_daily_borr_export.bat' is not recognized as an internal or
external command, operable program or batch file.

The text of the file is :
isql -S192.168.36.2 -Pmypassword -Umyusername
-iD:\Horizon\melcat\melcat_daily_borr_export.txt -b -h-1 -n -w800 -O
-ozv056pat%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%.txt

I have tried running the command with the name in quotes, I have
changed the file to a .cmd rather than a .bat, all to no avail.  The
sql that the file calls will run and return results.  Yes I am using
my proper user name and password.

The text of the sql called is this:

use horizon
go

set nocount on
go

SET CONCAT_NULL_YIELDS_NULL OFF
GO

select
char(34)+convert(varchar(15),b.borrower#)+char(34)+char(44

Upload Multiple File using JQuery in asp.net

  
In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa

  

If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009


Running multiple websites in Sharepoint 2007 with AX2009 Enterprise Portal

  

I need to setup two separate webshops with public access and different layouts using AX2009 Enterprise Portal.

However I am uncertain how to implement two completely different layouts/designs because the Sharepoint Templates are located inside the 12 hive and not seperate for each website.

Can anybody give me some hints on how to do this - and if so, which requirements I have to meet (VSS 3.0 or MOSS Standard / Enterprise) in order to do it.

I am speculating whether I need to setup two separate web-servers with each own Sharepoint installation (and Business Connector Proxy)

Thanks in advance

bhlj


Using the single *.rpt file with multiple data sources

  

I've created a set of CrystalReports (*.rpt files) for an ASP.NET web app on a development server. I call each report using the following code:

protected void BTN_RunReport_Click(object sender, ImageClickEventArgs e)
{
CrystalReportViewer_ClientLetter.Visible = true;

ConnectionInfo con = new ConnectionInfo();
con.ServerName = Constants.ServerIP;
con.DatabaseName = Constants.DatabaseName;
con.UserID = Constants.UserID;
con.Password = Constants.Password;

CrystalReportViewer_ClientLetter.ReportSource = Server.MapPath(Constants.ClientLetters);
ParameterFields parameter = CrystalReportViewer_ClientLetter.ParameterFieldInfo;
ParameterField batchdate = new ParameterField();
batchdate.Name = "@BatchDate";
ParameterDiscreteValue batchdate_value = new ParameterDiscreteValue();
batchdate_value.Value = Convert.ToDateTime(txtBatchDate.Text);
batchdate.CurrentValues.Add(batchdate_value);
parameter.Add(batchdate);

foreach (TableLogOnInfo tlf in CrystalReportViewer_ClientLetter.LogOnInfo)
{
tlf.ConnectionInfo = con;

Error using multiple webconfigure file in ASP.Net 3.5

  
when i using mutiple webconfigure file in .net 3.5 ,error Comes t is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

Running a single SQL update query on multiple foxpro databases

  
Hi, Env : SSIS 2008 My requirement is to run a update SQL statement on multiple foxpro databases. The fox database paths are available in a SQL server table.  I've created a for each loop control and assigned the database path to a variable named dbpath. Within the loop, I added an "execute sql task" control. Now what properties are to be set to get the requirement done. Appreciate any help. Regards. BH  Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. BH

Consistently running out of page file memory with full text indexer

  
Using MS SQL Server 2008 SP1 x64 Standard Edtion on Windows 2008 R2 Enterprise, I'm about to full-text index for the first time 1 table and 2 views. The table contains about 250'000 entries with a data space of 180 MB. As soon as I activate the full text indexing, the fdhost.exe task starts to consume slowly but surely all the available page file space (this can be easily watched using the Resource Monitor and the Commit Charge graph on the memory tab). Once all the virtual memory has been consumed, the server becomes unusable since it can't open any new windows any more, and RDP stops working. The machine specs are as follows: 12 GB of RAM 80 GB free on hard disk out of 136 GB 8 CPUs Custom size paging file with sizes between 24 GB - 60 GB (originally, this was system managed size, but then the server ran out of memory sooner) Max SQL server memory set to 6 GB (first 10 GB, then 8 GB) I've set the max fulltext crawl range to 8. During the indexing, the 8 CPUs are bit busy for a while, but not excessively. What is astonishing is that there is almost no use of physical memory during the indexing (I can see an increase from 2 GB to 3 GB which still leaves plenty of RAM available). Does anybody have an idea how I can convince fdhost.exe to consume physical memory and leave the paging memory alone? Or what else can I try?

Problems running a bat file within a SSIS package

  
I have a ssis package which has 2 tasks, first it builds an excel sheet with data on the server from where I am running the ssis pkg and the second task (a sql process task), runs a bat. the bat file that basically copies the  excel sheet created from the first step to another server. Problem is that the ssis pkg runs succesful when i run it from BIDS, bust when I run is as ajon, it gets hung. It completes the first step, it is the sescond step that is get hung. I noticed that when i run from BIDs, it does come up with a window open file - security warning and says the publisher could not be verified, are you sure you want to run this software. why does it do that ??? the file I am asking to run is a .bat file. it should automatically use the cmd.exe app to run the bat file. Please help !!!   Thanks in advance.

SSIS multiple data flows accessing the same raw file

  
I have multiple data flow tasks accessing the same raw file at virtually the same time.  I would like to know if the data flow tasks lock the raw file during read?  Can multiple data flow tasks read the same raw file at the same time.  I'm currently developing with a very small data set, but I would like to know if I should be concerned with the possibility of the data flow tasks competing for access to the same raw file. Thanks.

Run a batch file at server side

  
Hello,         I am creating an intranet application which runs a batch file and create an xml file as result. Which i am using for further processing. My problem is when i am running my application from local machine batch file is running fine and creating xml,but when i am running it through iis nohting is happening,it meance process.start coudn't start command Prompt.I am using following code. I have given all permission to iis.Dim ProcessInfo As Diagnostics.ProcessStartInfoProcessInfo = New Diagnostics.ProcessStartInfo("cmd.exe", "/C " + Server.MapPath("~\myScript.bat"))        Dim Process As New Diagnostics.Process       ProcessInfo.CreateNoWindow = False        ProcessInfo.UseShellExecute = False        Process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal        Process = Diagnostics.Process.Start(Server.MapPath("~\Spandata\RunSpan.exe"))       Process.WaitForExit(20000)        Process.Close()

ssis 2008 Loading MULTIPLE EXCEL file

  
HI it is possible for me to load multiple text file using for each loop,but if i try the same process for EXCEL file then my excel source throws an error. Also when i created my variable in value  i have given the path of my excel file ,still it didnt help me..because the moment i map the variable with the connection string of source excel connnection(property->expression->connection string) it start giving error if you could help me or provide some reference it will be of great help http://bi-polar23.blogspot.com/2007/08/loading-multiple-excel-files-with-ssis.html i tried this link but got stuck with it on step 12 and 14 (below  is my connection string) and variable is @Filename which i have created Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\mushtaq.sheikh\Desktop\ForEach\New Microsoft Excel Worksheet1.xlsx;Extended Properties="Excel 12.0;HDR=YES"; The moment i try to edit my connection string by comparing connection string provided in link it gives error(an OLEBD error has occured with error code 0x80040E73) on excel source Thanks in advance

Multiple File Uploads and blocked file types.

  
Hi hopefully someone can help me with this. I have removed a few file type extensions from the blocked file type administration interface (.ascx, ashx, dll) etc. If I browse to my shared folder I am able to load files of these types into my shared folder on a file by file basis, if however I try and use the drag and drop activex control facility for multiple files provided for IE8, files of these types are still blocked. If I also map a network drive from my PC to the shared folder and attempt to copy files of the above types, they're also being blocked. Perhaps someone has come across a similar issue and can shed some light on what they did to overcome this problem. Kind regards Paul

passing result from CS file to batch file?

  
Hello,I am trying to run a CS file within a batch file but so far nothing happens.. echo on cd \ net use z: \\CONFIGMGRTEST\SMSPKGC$\TST00014 rem FFCS-MultiPlatform.bat file rem a selection is made to know which program has to be launched rem SETTING THE LOCATION OF THE C# COMPILER SET framework=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727 rem COMPILING THE CS FILE %framework%\csc Architecture-Processor.cs rem EXECUTING THE C# APPLICATION :32BIT C:\Source Files\Packages\FOREFRONT\x86\FFCS.bat goto END :64BIT C:\Source Files\Packages\FOREFRONT\x64\FFCS.bat goto END :END exit and the CS file is: using System; using System.Management; public class ManagementObject { public static void Main() { /// ManagementObject mo; mo = new ManagementObject("Win32_Processor.AddressWidth=''"); ushort i = (ushort)mo["Architecture"]; /// Test the Processor and populated the field to be tested in the batch file switch (i) { case 0: return "32 Bit"; break; case 9: return "64 Bit"; break; } } } How do I pass the 32 Bit and/or 64 Bit collected by the CS file to the batch file to be used to the if .... goto 32Bit or 64 BitsThanks,DomSystem Center Operations Manager 2007 / System C

Can not find file when running app (I give up!!!)

  
Ok, I give Up!!!I created a deployment project in VS 2008.   It packages a Windows forms app.1- My application includes two XML files that that it needs to read from.  Those files were added into the solution.2- After installing the app via my deplyoment project, the app can not find the XML files that it needs,  it tells me that System IO can't find the XML files3- I notice that when the files are read, the app tries to read from the User\myprograms etc area.  Sometimes they are read from windows\system32 4- After I had added the files to my Windows forms app  I never specified a path when retrieving.  I figured the system was going to choose the application folder once deplyed and read from the same.  Maybe this is where the fault exists.  The application runs fine from Visual Studio.Can someone tell me if I have to specify a folder or if I have to use some sort of default syntax to make sure the files are written and read from the application folder.  The XML files have had the write always property set to true.I have tried moving the files around to no avail.  The code that loads one of the files is simply:xelement doc = xelement.load("myxmlFile.xml");??? NR

Batch file for use with SSIS

  
Greetings all, I'm trying to run the following batch file outside of SSIS.     DTEXEC /f "M:\Tim\SSIS\ImprtInvestOneNAVsGeneric.dtsx" /conf "M:\Tim\SSIS\EPIC.dtsConfig"      \Package.Variables[User::FilePath].Value;"M:\Tim\SSIS" /SET      \Package.Variables[User::SourceFileName].Value;"DIREXION_NAV.CSV" /SET         \Package.Variables[User::DoneFileName].Value;"BIAUSC50.DONE" /SET      \Package.Variables[User::SponsorID].Value;"56" /SET      \Package.Variables[User::FileDescription].Value;"Direxion NAVs (USA)" /SET      \Package.Variables[User::DBConn].Value;"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=M:\Tim\New             Basket DB\EPICUDT_Development.mdb;User Id=admin;Password=;" /SET  The purpose of this batch file is to allow our team to use the same SSIS package but with multiple file inputs. I am getting the following errors:   - Requires a higher level edition.  I've done some research on this and have found that you must have SSIS installed locallly (which I         do, the services indeed running).  I've also come across a 'fix' that says you can use the E

run dtexec on server from batch file on client machine

  
Hi I would like to enable a user to execute an SSIS (2005) package located on a server.  The client does not have any elements of SQL server installed on his machine so he cannot execute the package locally.  At present he has to remote connect to the server and double click a batch file on the server that contains the dtexec script. I would like to have a batch file located on the client desktop that he can click, that will run the dtsexec script on the server - as it will not work from the client machine.  However every set of commands i try inevitably end up trying to run the package on the local machine, which obviously fails. Is there any way to have the client kick of the package and have it run on the server, without him actually having to directly remote desktop to the client? Thanks  Guy
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend