Search found 11 matches

by bex
31 Mar 2009 07:07
Forum: DOS Batch Forum
Topic: Help to code loop script
Replies: 7
Views: 11504

Ok, I'm ALMOST there. There is still one thing that is puzzling me. Here is the code: ::@ECHO OFF setlocal enabledelayedexpansion SET Count=0 SET MaxTranID=6 SET CurrentStoreCount=3 SET StoreNo1=16 SET StoreNo2=17 SET StoreNo3=18 SET NewStoreNo1=16 SET NewStoreNo2=17 SET NewStoreNo3=18 ::Create dire...
by bex
31 Mar 2009 05:52
Forum: DOS Batch Forum
Topic: Help to code loop script
Replies: 7
Views: 11504

SOrry sorry sorry, you have already given me the answer, i just didn't apply it in all the right places! Doh!!!

REMOVE WHITE SPACES!!!!!

SET Count=1
SET MaxTranID=6
SET CurrentStoreCount=3
SET StoreNo1=10
SET StoreNo2=11
SET StoreNo3=15

Thanks for your help guys!
by bex
31 Mar 2009 05:37
Forum: DOS Batch Forum
Topic: Help to code loop script
Replies: 7
Views: 11504

Hmmm, still not working. Basically, i have slightly changed the command (as the bcp with BULK INSERT was not working). This new command works, but I keep getting an error regarding duplicates. This means that the changes to TranID and StoreNo are not working: ::@ECHO OFF setlocal enabledelayedexpans...
by bex
31 Mar 2009 02:31
Forum: DOS Batch Forum
Topic: Help to code loop script
Replies: 7
Views: 11504

Thank you both. I'll try it now and get back to you! :lol:
by bex
30 Mar 2009 10:45
Forum: DOS Batch Forum
Topic: Help to code loop script
Replies: 7
Views: 11504

Help to code loop script

Hi there I have a script (below), where I know what I want to acheive, but I just don't have adequate knowledge to actually do it. I have highlighted the sections in red that I know are not correct: @ECHO OFF setlocal enabledelayedexpansion SET Count = 1 SET MaxTranID = 6 SET CurrentStoreCount = 3 S...
by bex
27 Mar 2009 07:55
Forum: DOS Batch Forum
Topic: BCP script not working
Replies: 0
Views: 5057

BCP script not working

I have the following script, and it is not working....I execute the BAT file, it completes, yet nothing has happened: bcp sainsburys.crdm.Header_20070613 in "SELECT 321561+TransactionID, InsertedDateTime, DATEADD(DAY,14,EndTransDateTime), StoreNo, POSNo, TicketNo, TradingDay, StartTransDateTime...
by bex
25 Mar 2009 12:30
Forum: DOS Batch Forum
Topic: Domina error when trying to execute BAT file on SQL Server
Replies: 2
Views: 5577

Thanks for your reply!

That has certainly helped :)
by bex
25 Mar 2009 11:15
Forum: DOS Batch Forum
Topic: Domina error when trying to execute BAT file on SQL Server
Replies: 2
Views: 5577

Domina error when trying to execute BAT file on SQL Server

I have created a BAT file to run a procedure that, in turn, creates another BAT file based on the tables within the database. This was working locally with no issues. I have now logged onto the database server, and have tried to execute the first BAT file, but obtain the following error: Msg 3623, L...
by bex
25 Mar 2009 03:39
Forum: DOS Batch Forum
Topic: IF Statement not working
Replies: 4
Views: 7749

Thanks for your help. I shall try that today. :D
by bex
24 Mar 2009 08:51
Forum: DOS Batch Forum
Topic: IF Statement not working
Replies: 4
Views: 7749

Hi there

Thanks for the reply.

When I add the '%', the bat doesn't run (or rather, it does run, but doesn't execute any of the commands).

However, when I do not include the '%', the file runs as per norm, but does not execute the command after the IF statement.

Any other ideas?
by bex
24 Mar 2009 05:45
Forum: DOS Batch Forum
Topic: IF Statement not working
Replies: 4
Views: 7749

IF Statement not working

I have the following code (reduced for example purposes): @ECHO OFF SET count = 1 FOR /l %%G in (1, 1,2) DO ( ECHO CALL :parameter_count "%%G" IF count == 2 (sqlcmd -S WS23 -E -d sainsburys -Q "DROP TABLE dbo.NewStoreMapping;") ) :parameter_count ECHO RUNN...