SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQLCMD returns the sql statemetn
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

594 Posts

Posted - 12/12/2013 :  11:37:28  Show Profile  Send TRACEYSQL an ICQ Message  Reply with Quote
sqlcmd -S Servername -E "EXEC myprocedure 'myvalue',''" -h -1 -o c:\test.txt -e

the text.txt keeps putting in
exec myprocedure 'myvalue'

I only want the DATAVALUE to return

The sp has a return output value and when run it returns just the DATAVALUE, this parts is working

What switch is needed to not write the sql script to text file.

After this is working i wish to read if COMPLETE do this or EXIT

---Anyone got example

set /p myvar=< c:\test.txt
echo The sql variable is "%myvar%"

@rem if "%myvar%"=="" (echo MyVar is Not defined)
@rem else (echo MyVar is %myvar%)

@rem if "%myvar%"==COMPLETE goto start

@rem if "%myvar%"=="" goto cancel

@rem :start
@rem echo start
@rem pause

@rem :cancel
@rem echo cancel

Very Important crosS Applying yaK Herder

52325 Posts

Posted - 12/12/2013 :  12:02:24  Show Profile  Reply with Quote
Answered here

SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000