Accessing an SQL Server Database

Con risposta Accessing an SQL Server Database

  • Tuesday, May 08, 2012 4:44 AM
     
     

    Hi, I've created a database in SQL Server, it's fairly simple, it's function is just to keep track of inventory. Right now, I'm just accessing the data I need to look-up through Query Analyzer. I run stored procedures, update data, and run select queries through the query analyzer. If I need to look something up, I write a select statement and run it through the Query Analyzer.

    My question is, should I create a simple application that can run the T-SQL code so I don't have write new select statements all the time for queries?
    I'm not sure how to go about developing something to access my data in the database. Would I need to get something like Visual Studio that could run my T-SQL statements behind the scenes? Do stored procedures have to be written in T-SQL? Would something like Crystal Reports work well for me? I just want to view products in the database, add new ones, and update data. Is it a bad idea to use query analyzer to fetch all my data? I think a simple application to talk to the database would be much simpler. Just not sure where to start or what to use or write it in. I want to keep it fairly simple. Any help is appreciated. Thanks!

All Replies

  • Tuesday, May 08, 2012 4:56 AM
     
     

    If you want to use Visual Studio as an application , with connecting your database (SQL) to VS , you can access the data

    from your database easily and through this work there will be several queries that can perform what you want .

    although this possible in ASP.net through connection to database.

     
  • Tuesday, May 08, 2012 4:59 AM
     
     

    As per my understanding you are using a stored procedures to update the data. In the same procedure add some code to insert updated data into a table and export the file to file system.


    ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

  • Tuesday, May 08, 2012 5:11 AM
     
     Answered

    Raptor_45,

    Thanks for visiting MSDN forum, and yes you are right, if you want to save your time and effort for writing the SQL queries every now and then for the task, there are many ways to do such things.

    1.  Would I need to get something like Visual Studio that could run my T-SQL statements behind the scenes?

    Yes you will need Visual Studio to create a front end application (Windows or web applications)

    2. Do stored procedures have to be written in T-SQL?

    Yes, though there are CLR procedures, but for now you can write the SPs in T-SQL

    3. Would something like Crystal Reports work well for me?

    It depends upon what all you want to do, Crystal report is the reporting tool for creating reports

    4.  I just want to view products in the database, add new ones, and update data. Is it a bad idea to use query analyzer to fetch all my data?

                  We can not say bad idea, but you have to save your queries which is to be used frequently, I suggest you to create an SP and you can call your SPs from the front end applications developed on Visual Studio.

    5.  I think a simple application to talk to the database would be much simpler. Just not sure where to start or what to use or write it in.

             Please refer

    1.  http://www.developerfusion.com/article/4278/using-adonet-with-sql-server/
    2. http://msdn.microsoft.com/en-us/library/32c5dh3b(v=vs.90).aspx



    Thanks
    Manish

    Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

  • Tuesday, May 08, 2012 4:00 PM
     
     
    Could I write the Windows Application in C++ through Visual Studio since I have a little C++ experience? Or would VBasic be better? I would want to take user input from C++ code and pass it to T-SQL statements to get the data returned I want right?
  • Tuesday, May 08, 2012 10:33 PM
    Answerer
     
     Answered
    If you have Microsoft Office, consider using Microsoft Access. Access can connect to the SQL Server database and link to the tables. Then save queries, and create forms and reports.

    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty