Can An One Help Me With Writing A Simple Batch Fileee...Pleasee

Apr 25, 2008



Ok I have 2 batch files and I have rum them one after one another. I am using

call batch1.bat
call batch2.bat

It is running the 1st batch fil successfully but it is not running the second one. I used a pause to see th e error it says some internal and external batch error.

Ok batch1 is at the desktop. and batch2 is in one of the folders in the desktop.

Nature of batch1 is that it runs successfully.

Nature of batch2 is that it gives and error if I individually execute it. But when I am running together then its not showing the error.l

Please if u did not understand this situation atleast show me how to run two batch files using command lines.

Thanks

View 6 Replies


ADVERTISEMENT

Writing Sqlcmd Batch Files To Do Bulkfile Copies Or Imports

Sep 23, 2007

I want to write a batch file that will do just that. The problem is bcp or bulkcopy never works with my code, it doesn't recognize it. Maybe I'm going the wrong way to do this, but I could use some help. Ideally I'll make the batch to do the importing via bulkcopy or something like it of a text file into a table and use windows scheduler to automate it. Be as specific as you can please, I'm very new to sql server.

View 6 Replies View Related

Simple Batch Program Example

Sep 7, 2006

Can someone point me to some examples of batch scripts that will allow me to write a simple tool which can reliably detect if any instances of SQL servers are running on a machine and if running, then their names.

Hopefully the tool should be robust enough to run on diff flavors of MS Windows.

Thanks

View 1 Replies View Related

Simple Batch Job Handling

Mar 6, 2008

Hi!
I was told SB could be a good solution (-:

What I have now:
Machine with 8 cores and 8 scheduled jobs running every minute to check
if there is new row in one queue table (rows assigned to queues/job by using modulus 8 on identity column).

The scheduled jobs run an stored procedure, that filter "its own" rows from queue table (scheduled jobs sends input parameter to proc, so proc can identify which queue it is).

Inside the proc an dynamic, local cursor is used where I order-by on column corresponding to source of request, since some peoples requests are more important than others ;^) Every queue handles more rows at once if exists.

This gives me 8 paralell queues, but since some requests take longer to handle than other I can see periods
where only 4 queues running and the rest does nothing while jobs are waiting. There are probably other drawbacks, please tell me.

How to solve this with Service Broker?
Do you know some good links with examples?
Can SB support the need of ordering? It should not be first in - first out, it should be: most important first...

Best Regards
Bjorn

View 1 Replies View Related

Writing A Simple Function

Jun 26, 2007

Hi, I need to write a simple function to format the contents of the fields in my table. I bascially want to say that if the value in a field is below '0' then format the text in colour red and if the value in the field is 0 or above then format it in black. Obviously this can be done by writing an expression in each field but i would prefer to write a function - any ideas.....

View 1 Replies View Related

Can U Guide Me Writing A Simple Query

Jun 26, 2007

I am trying to do following thing:i got a table which contains some words....all i need to do is whenever i see a word starting with 'R', i need to remove the starting 'R'  and update it in the same table... could anyone help me out here.....thanks a lot in advance......... 

View 2 Replies View Related

Request Help Writing A Simple Trigger!

Feb 26, 2008

Experts: Please assist with coding a trigger for a SQL Server 2005 .NET application.

Here's the scenario:

Suppose there are tables MEMBERS, ACTIVITY, and HEADCOUNT that look like this:

MEMBER
member_id (int)
member_name (varchar(50))
...etc

ACTIVITY
activity_id (int)
activity_name (varchar(50))
...etc

HEADCOUNT
headcount_id (int)
member_id (int)
activity_id (int)
...etc

Suppose also that the ACTIVITY table is already populated with several records, say with activity_id = 1, 2, and 3.

OBJECTIVE: When a new member record is added to MEMBER, say member_id 10, insert one record in the HEADCOUNT table for EACH activity in ACTIVITY for that member. Thus, if member #10 is added to MEMBER, then the trigger (or some other mechanism) would add the following records to HEADCOUNT (which, say, already has 30 records):

headcount_id member_id activity_id
31 10 1
32 10 2
33 10 3

I've been advised that a trigger should do the trick for this, but as I'm totally new to SQL, I'll need some help. I'm guessing some iterating SQL command language might be required, but as I'm new to SQL, I don't know how to proceed.

Note that I'm building an ASP.NET application based on VB, and so records will be added to MEMBER through a tableadapter INSERT command. (Though I suspect this has no bearing on trigger behavior.)

Much obliged for your assistance.

-Kurt Euler
San Jose, CA

View 8 Replies View Related

Simple Question On Writing Query

Apr 20, 2006

Hi,

I have two little identical tables.

Pdates - (here pid is foreign key field linked to diff table proposal)

pdate

pid

pkid-primary key

Cdates - (here cid is foreign key field linked to diff table confirm)

cdate

cid

tid

strttime

endtime

pkid-primary key

I wish to just copy the records from pdates to cdates selected based on pid value with diff cid. The other fields tid,strttime and endtime will be updated later.

what kind of query should I use?

as I am a newbie to SQL server can anybody help

thanks, regards.

View 5 Replies View Related

Writing A Simple Replace Query.. Another Question

Mar 21, 2006

http://forums.devshed.com/ms-sql-development-95/writing-a-simple-replace-query-335014.html

So, what if I wanted to do a search and replace for a single quotation? I can't use that in my search. How to get around that?

example:

Code:

update NamTable
set namstr=replace(namstr,''','')

View 1 Replies View Related

Urgent Help Needed....pleasee Help Me

Nov 5, 2007

i need urgent help sorting out my SQl please....
i have 6 tables
Student
class
lectures
student_results
attendance

my case study says " the system should be able to record attendance of student to any class. the system shoul also be able to automatically send out a warning to any student that misses any two lectures for the first time."

can anyone help me solve this problem on SQL (oracle) please...

charles

View 6 Replies View Related

Passing Parameters To Batch File And Executing Batch File Loop

Aug 7, 2007

HELP,

I need to take a variable from a tabel in SQL Server pass to a Batch file and execute the batch file. Right now I can exec the batch file with XP_CMDSHELL but how can I pass the variable to the batch file and loop through all the variables.

Please help

Phil

View 4 Replies View Related

SQLCMD Batch File With Script In Batch File

Dec 5, 2006

I am using the following batch file to execute a script that creates a db and all its objects in the local sql express:

sqlcmd -S (local)SQLExpress -i C:CreateDB.sql

This works fine, but I'm wondering if there's an easy way to put the script in the batch file, so users don't have to worry about putting the script in the C drive. I tried getting rid of the i parameter and pasting the script from the sql file into the batch file, but it didn't work.

Thanks,

Dave

View 1 Replies View Related

Simple Simple Linking Tables & Perform Calculation

Mar 22, 2007

found it

View 3 Replies View Related

Simple Question (Hope Simple Answer Too)

May 26, 2004

Hey,

I have MS SQL database.
I have procedure:



code:--------------------------------------------------------------------------------
CREATE PROCEDURE dbo.Reg_DropTable
@ModuleId varchar(10)
AS
declare @TableName varchar, @kiek numeric
set @TableName = 'reg_'+@ModuleId

begin
DROP TABLE @TableName <- HERE I GOT ERROR
end
GO
--------------------------------------------------------------------------------


I got error when using variable with tables names.
How to do this?

Ps. Number is send to this function and it must drop table with name Reg_[That number]

View 1 Replies View Related

Simple Join Not So Simple

Feb 21, 2007

I am receiving funny results from a query. To simplify, I have 2 tables (todayyesterday). Each tbl has the same 8 columns. My query joins the two tables then looks where either of two columns has changed. What is happening is that when checking one of the columns it seems as though sql is flipping the column, causing it to be returned in error.

result set

colA colB colC colD colE colF colG colG (from yesterday)
1 1 a b c d e m
1 1 a b c d m e

So what's happening is that the record above is actually the same record and should not be returned. There is a daily pmt column that changes but I am not using that in the query. Aside from that the two records are identicle.

Any help is appreciated.

View 7 Replies View Related

Simple Join Not So Simple

Aug 19, 2006

Hi,

I have the following situation (with a site that already works and i cannot modify the database architecture and following CrossRef tables -- you will see what i mean by CrossRef tables below)

I have:


Master table Hotel

table AddressCrossRef (with: RefID = Hotel.ID, RefType = 'Hotel', AddrID)
joins
table Address (key = AddrID)


table MediaCrossRef (with RefID = Hotel.ID, RefType= 'Hotel', MediaID)
joins
table Media (with MediaID,mediaType = 'thumbnail')


foreach hotel, there definitely is a crossRef entry in AddressCrossRef and Address tables respectively (since every hotel has an address)

however not all hotels have thumbnail image

hence i have hotel inner join AddressXReff inner join Address ..... however i must have
left outer join mediaXref left outer join media


the problem is that if there is no entry in Media or mediaXref, I don't get any results

i tried to get over it by using
where (media.mediaTyple like 'thumbnail' or media.mediaType is null)
but then i started getting multiple results for each hotel because media's of type movie or full_image or etc... all got returned


any clue?

thanks

View 5 Replies View Related

Batch Job

Dec 26, 2006

Hi,
I want to schedule a daily job using sql server to update the info. in a sql server table. This is very new to me. Could you please forward me some helpful resources.
Thanks,

View 3 Replies View Related

Batch SQL

Jul 25, 2006

QuestionsI need to batch a set of update commands. Can that be done and if so what are the possible ramfications? Can one mix / match Deletes/Inserts and Updates into a SQL command via the semi-colon in a batch set? (Is this the appropriate forum?)

WHYI am unable to use the
dynamic sql building found in the dataset due to a multiple table
contstraints. I have built classes that will extract the differences
from two datasets and report on the updates/deletes and inserts
required. Since I have multiple SQL statements, it would be nice to combine them into one statement.

Platform.Net 2C#IIS6SQL Server 2000 is the eventual target database for the generated SQL

advTHANKSance

View 1 Replies View Related

New To Writing In SQL

Jun 21, 2008

I have some experience with MS SQL mostly installation, configuration, maintaining, etc. But I am trying to teach myself some TSQL. I have bought a few beginner books and have some test machines. In advance, I appreciate any feedback!

I have a database with two tables. I want to calc the min salary for a class of employees. The "wage" is in one table and the "status" is in another.

USE Database
GO
SELECT MIN(Wage) AS "Min Salary", Status
FROM Employee, Job
WHERE Status = '1'
GROUP BY Wage, Status
GO

The result set brings back all not the "status" class that I want.

Again, I am relatively new so take it easy on me!

Thanks,
grinch

View 4 Replies View Related

Writing To SQL Log

Mar 3, 2008



Hello,

I wrote a stored procedure in SQL 2K5, and I would like to write to the sql log without using a rasieerror function. I just would like to log the sucessfull steps without exiting the proc. I am not sure how to do this. Any help would be appreciated.

Thanks,

Dave

View 3 Replies View Related

Writing To SQL

May 13, 2007

Hi,



I am new to this programming and SQL.



I am following the: Lesson 8: Obtaining Data from a SQL Server 2005 Express Edition Database video series. I cannot get the following to write changes to the SQL Database:



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

BindingSource1.EndEdit()

'CustomerTableAdapter1.Update(MyCompanyDataSet1.Customer)

Dim rowsAffected As Integer = 0

rowsAffected = CustomerTableAdapter1.Update(MyCompanyDataSet1.Customer)

MessageBox.Show(rowsAffected.ToString())

End Sub

End Class





I do get the message box to popup showing 1 row of changes when I make one change, however that change does not get written to the database. Is this enough info to have any idea why?





Thanks

View 1 Replies View Related

Batch Updating?

Mar 28, 2008

Hey guys, I periodically have to update maybe 300 records of the same column.. However, I've been udpating each record one by one.
Is there a way I can do something the following.ID   Name1    john2    chris3    adam4    ben5    steveupdate table1 set name = name where id = ? but have it run through an entire set of these? Is there any way of automating that rather than having to update it manually? Do i need another table with just the id numbers and the column I want to change? or do i need a txt file?

View 6 Replies View Related

Help With Batch File

Jan 22, 2002

hi,
I need some help in accomplishing this task.

I want to design a DTS task which will:
a)copy a certain given files from one directory to another
b)import the files into the tables
c)upon successful import delete the files from the original directory.

I done know much about scripting and need help in figuring out steps a) and c).
thanks
Zoey

View 2 Replies View Related

How To Run Different DTS Packges In A Batch?

Jul 31, 2001

Is there any way using to run already developed DTS pacalkes one after another.

Thanks

View 1 Replies View Related

Batch File

Sep 13, 2001

Do u know how to write a batch file
for example i will need to type the sql server name it has to connect to the server and run a script that I have

let me know if u have any ideas of doing it

View 2 Replies View Related

Batch File

Sep 13, 2001

Do u know how to write a batch file
for example i will need to type the server name it has to connect to the server and run a script that I have

let me know if u have any ideas of doing it

View 3 Replies View Related

BCP From A Batch (*.bat) File....

Mar 29, 2000

Can someone show me an example of the syntax required to execute multiple BCP commands within the same batch (*.bat) file?

Sorry if this is a bit of a basic question, but not being a programmer by profession, I need to plead ignorance. I've tried a few things, but I just can't seem to figure it out.

Thanks!

Rich

View 4 Replies View Related

Batch Process

Oct 22, 2003

I have a problem running a batch file, now the problem is that when i run the batch file the command prompts the user for an input, but I have all the output of the bat file going into a log file. So when i run the bat file the process just sits there until i hit the 'y' key or unless i nput sumthin manually. This is a problem becuase this batch file is running on the UAT server as a job and there is no one there to input once the job is running. The commnd in the batch only requires an input once a month.

for eg if run: launch_scrt.bat and i want to put sum parameters such as 'y' or 'n' to avoid the manual input once the job is running. Any ideas?

Thanks in advance

View 11 Replies View Related

Run A Batch Of Sql Statement

Sep 26, 2005

Hi There,

I want to able to run a batch of sql statments (execute procedures) in SQl Server at a specific time. Just wondering if there is a method for that.

View 2 Replies View Related

Batch Scheduling

Jun 27, 2006

I like to schedule set of jobs in sql server 2005 to run in a particular sequence. How do I schedule batch jobs? Each job is a set of packages. Idea is to create a job with multiple steps and each step should be a one job but there is no option for the "sql server agent jobs" when mentioning each step.

Any idea how to create a set of jobs in sequence?

Thanks in advance,
Maria

View 2 Replies View Related

Batch Job In Scheduler

May 6, 1999

What is the best way to run a scheduled task that fires off three scripts that need to be run sequentially? I could set up three different tasks but I don't know exactly how long each will take and they are interdependent.

View 2 Replies View Related

DTSRUN Batch Job

Aug 10, 2004

Hi all

I have a batchjob which runs a DTS package now it calls it ok
However it is running against 2 Databases on 2 servers and I get a login error even tho I am using the sa login

does anyone know of any issues relating to this Hopefully with a soloution that does not involve a lot of work

thanks

Michael Grieve

View 7 Replies View Related

Batch T-SQL Scripts

Sep 27, 2004

In Horacle (thanks to someone else for the apt pseudonym), I am able to run a PL/SQL script saved as a file by simply typing in @ plus the path and file name. So, if I have a script called E:CreateTable.sql, I can simply enter @CreateTable.sql from the SqlPlus command line and Oracle will attempt to run all the commands in the E:CreateTable.sql file (there may be one or more commands).

Can I do the same thing in Query Analyzer (or even osql)? If so, what is the correct syntax?

Thanks,

hmscott

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved