How to excecute a SELECT statement from a computer w/o SQL SERVER to produce a text file from SQL server?

  • I have a computer that is NOT a SQL server and that has only ODBC access to an external SQL server. What is the best way to execute about 10 SELECT statements, producing a text file on my computer for each statement? I cannot use anything on the SQL server (BCP, Jobs, Scheduler, etc) that has the data. All functionality must reside on the pulling computer which does not have SQL server. I haven't used ODBC since doing web development with VB6 and I think I could just create an .exe that references ado and uses an ODBC DSN to execute the statements, but I'm wondering how to do that best with .net, or if there's another tool that provides more automation.

    By way of background, we have a client whose software vendor is grudgingly allowing us access to their SQL server, but only from a minimally configured computer that cannot have SQL server installed. They also will allow, nor do, anything on their SQL server to assist with getting the data. They have said we could use an ODBC connection though.

    Thanks!

  • malik_nagel (11/21/2010)


    I have a computer that is NOT a SQL server and that has only ODBC access to an external SQL server. What is the best way to execute about 10 SELECT statements, producing a text file on my computer for each statement? I cannot use anything on the SQL server (BCP, Jobs, Scheduler, etc) that has the data. All functionality must reside on the pulling computer which does not have SQL server. I haven't used ODBC since doing web development with VB6 and I think I could just create an .exe that references ado and uses an ODBC DSN to execute the statements, but I'm wondering how to do that best with .net, or if there's another tool that provides more automation.

    By way of background, we have a client whose software vendor is grudgingly allowing us access to their SQL server, but only from a minimally configured computer that cannot have SQL server installed. They also will allow, nor do, anything on their SQL server to assist with getting the data. They have said we could use an ODBC connection though.

    Thanks!

    why not connect with a completely portable application like Linqpad? it's portable, and has feaures like SSMS: an object explorer, multiple query windows, and the ability to save to html and raw text formats. I personally carry it on a thumb drive for situations where i am granted access, but cannot install anything.

    no need to script anything or reinvent the wheel. there are other, similar apps out there, but that is my recommendation.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Another, nearly perfect way, to connect to the remote SQL Server is through Microsoft Access. You have drivers and everything that is necessary included in Access, and you can simply use Access as a front end, and SQL Server as a back end. Basically it is now classic client / server setup. You get all the user friendly bells and whistles on the MS Access side and you'll be forgiven for thinking that SQL Server doesn't even exist.

    You might get some limitations with executing stored procedures, but for a beginner that is academical.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply