Newb with SQL in school learning - class project help

  • Okay here is my situation, I have a database that I had on my website and I want to use it for my class project. Well I'm sure it was MySQL not SQL but with some time I have gone in and fixed a lot of the code.

    Here is my problem being new to the whole SQL I am missing some of the basics and I have searched on the forums and Google but I don't think I'm asking the right question. I'm hoping you can help me understand what it is that I'm doing wrong.

    When I uploaded the .sql file it had 23,000 lines of code I am 50% done with fixing the issues but I saved the project and now I have no idea how to open all the lines of code. I know it has to be with New Query but how do I get everything. so I can see all the errors that it is creating and I can go in and fix them.

    Please ask me questions its the only way I can learn and understand the basics better.

    Thanks

    KC

  • I must have missed it but if a moderator would move this in to the Newbie section would be great...

  • Hi, there is a "Parse" button in ssms which tells you some incorrect syntax of the t-sql.

    For tracking what you've changed you can use a SVN, e.g.: http://www.simple-talk.com/dotnet/.net-framework/tortoisesvn-and-subversion-cookbook-part-9-server,-repository,-and-statistics/

    Download link http://tortoisesvn.net/

    Igor Micev,My blog: www.igormicev.com

  • Hi

    If I've understood your question, you've saved your code using 'Save solution'. If your SQL was copied into a new query window then you would have been prompted for a file to save to. This will generally go to 'User Directory\My Documents\SQL Server Management Studio\Projects'. You should also be able to get to it from the 'Recent' drop down menu in the 'File' menu.

    Personally for large SQL scripts I try to break them up into smaller more manageable chunks and merge them back together to run if necessary. Most of the time this isn't necessary though.

    Micky

  • If this is MySQL then this isn't really the right place, this site is for Microsoft SQL Server, but the first question I would ask you are what tools are you using? How did you 'upload a file'?

    Most website management systems would give you access to something like PHPMyAdmin or some other web based tool for running queries and managing your MySQL Database. If it's SQL Server, are you using SQL Server Management Studio, or some other software?

    When you say you 'uploaded a .sql file' it makes me think that you haven't actually run the code against the database so it is not really saved within your database. Maybe you've uploaded the .sql file to your webserver? (which would do nothing)

    MySQL and SQL Server don't store .sql files as part of their schema, you run the SQL script and it then makes changes to the database. For example if you are creating a procedure or function, it will store that object and its definition in the database itself, not as a separate file. Maybe you know that.

    It sounds to me like you are struggling with how the tools work, not with the SQL Language.

Viewing 5 posts - 1 through 4 (of 4 total)

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