WinBatch® Technical Support Forum

Archived Boards => COM Automation and dotNet => Topic started by: CoreyGlenn on January 15, 2014, 12:38:06 PM

Title: Need Help to Open and Load SQLServer 2012 DB from WinBatch
Post by: CoreyGlenn on January 15, 2014, 12:38:06 PM
Though I am very familiar with WinBatch programming using flat files, working with databases is a first for me.
Though not familiar with .NET, ADO, or CLR, I am willing to do learn the best approach to open and load and query my SQLServer 2012 Database using winbatch.

Both the script and database are running on VMWare server with Windows Server 2008 (64bit) as the OS
I'm running 32 bit version of Winbatch.
The access to the database is a trusted connection (using windows authentication).

Does anyone have any straightforward examples to share? Also, what documentation would you suggest to better understand what's happening behind the scenes?

Thanks,

Corey
Title: Re: Need Help to Open and Load SQLServer 2012 DB from WinBatch
Post by: Deana on January 15, 2014, 01:37:12 PM
We have a number of Examples and tutorials that should help get you started with ADO and WinBatch.

Here are a few links that should get you started:

ADO Tutorial: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+Tutorials/OLE~TUTORIAL+ADO.txt

ADO Example: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/ADO~DAO/Samples~from~Users+udfSQLExecute~GetString.txt

dotNet Example: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/dotNet/System_Data+Get~Database~Results~into~a~WIL~Array~and~Display.txt
Title: Re: Need Help to Open and Load SQLServer 2012 DB from WinBatch
Post by: stanl on January 16, 2014, 09:06:10 AM
Adding to what Deana wrote. I played around with the 2012 Trial, and scripts written for 2005/2008 worked with it. So don't be shy to try one of the multiple scripts posted in the tech db (even if they say tested with 2008).

The only downside which has nothing to do with coding is that after I removed the trial and reinstalled 2008, the 2012 .mdfs cannot be used with an earlier version; so I have about 2 gig of data I can't open.