Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Dos Batch file.

Author  Topic 

Deon Smit
Starting Member

47 Posts

Posted - 2008-08-18 : 04:52:31
Hi all. I am looking to let a worker do a query on sql but do not want him to use the server. All I want to do is Create a Batch file so that it returns the rows on screen.

For example. It must ask What voucher Nr you want to querie.

The it must run the following.

SELECT PT.PosTransactionID as TransactionID
, PT.LmDateTime as DateOfPurchase
, PT.TotalExcl as VoucherValueExcl
FROM UC_PosINF PSI
JOIN UC_PosTranDet PTD
ON PTD.Rowguid = PSI.POSTranDetID
JOIN UC_PosTransaction PT
ON PTD.PosTransactionID = PT.Rowguid
WHERE PSI.Value = 'VOUCHER NUBER I ENTERED'


Any help would be app...

Regards

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-18 : 04:59:56
Have a look at OSQL utility in books online.
Go to Top of Page

Deon Smit
Starting Member

47 Posts

Posted - 2008-08-18 : 05:35:58
Thanks

It worked GREAT!!
Go to Top of Page
   

- Advertisement -