Querry

  • Hello,

    I am working my way around the enterprise manager and getting more comfortable with all that sql has to offer. And while querrying from inside the manager (by right clicking on the table in a database) that there is not a option to insert a new column into an existing table. Is there a work around for this, or am i missing something?

    The reason that i am asking is for Example: When working with my application i will get to a certain situation that i will need a column added and at this point the only way that i know how to add a column is to do it in design mode and if i want to fill with values i will then right click and do a update.

    Can someone give me pointers on this.

    Erik...

    Dam again!

  • In EM when you right click on a table there are many options available to you.

    New Table,

    Design Table

    Open Table

    Full Text

    All Tasks

    Cut

    Copy

    Delete

    Rename

    Properties.

    Try all these options out to see what they do. Of course Delete is not a good idea.

    But what you want to do is go to the Design Table Option. It will open the table definition in design view, and from there you can add a column to the end of the list, and specify a data type, or you can right click and insert a column between 2 others.

    I would also suggest you lear the t-sql equivelent way of doing these tasks.

    Look thru books online, or purchase a book like Learn t-sql in 21 days. Not the best book ever, but good for beginners

     

     

  • Ok,

    Thanks,

    Erik..

    Dam again!

  • Select "Design Table" and then you will be able to add a column to the table definition

  • Thats is the procedure that i use, i just did not know if there was another way. 

    Also, when i am in the enterprise manager i noticed that when i right click on a table and select querry, and then after the querry box opens up i right click in the designer and select INSERT from,, THAT when i do that it actually places the table that i selected to INSERT FROM . to the postion to insert INTO.. What am i missing on this?

     

    Erik..

    Dam again!

  • I believe the pop-up box gives the explanation:

    Choose Target Table for Insert From

    An INSERT FROM inserts rows from the selected source(s) into only one table or inline function.

    The selected sources refers to the table(s) that you already have in the query design view and you are going to append to whatever table is chosen in the list of tables presented in the pop-up.

  • Ok,i see what is happening. Man, its great being a newbie, feels like Christmas every day...

    Seriousl,

    Thanks.

    Dam again!

  • Never looked at it like that, but that's a great outlook on life.  I'm going to try to use that myself.

  • I use EM alot to build my queries, because it is alot like the MS-Access query interface.  After I have the query built, I will usually copy the SQL and then paste it into Query Analyzer.  The query will timeout in EM if it is a long running query.  I haven't figured out how to set the timeout value for EM, so if you run across that in your adventures, please forward along.

    Thanks,

    Brian

  • At this stage in my learning experience, i have just now got comfortable querrying using sql2000, before it was only in the vb.net enviroment. Everything just seemed so overwhelming to me in the em so i stuck with the vb.net to handle the querrys. Now that i see just how powerful the em is i am keeping all of my foucs on the em and analyezer. (Since i am teaching myself you would not believe the steps i use to take for what seem simple task now).I AM not comfortable with the Analyezer yet. I am under the belief that the Analyzer is for more well seasoned (pros) database developers. Its just to much for me at this point. However, i do like to desinger the querry and them skip over to the analyzer to see the results.

    I have never worked with access, however, my understanding about access is that it is a good LOCAL database for small companys or just small solutions?

    Erik..

    Dam again!

  • Your view of Access is right.  It's much more efficient to house your data in SQL Server.  We use Access a lot as a front-end to build forms that access data in SQL Server. 

    Concerning learning, keep coming to this site.  I have found it to be the most helpful site on the web.  If you decide to dive into DTS, then SQLDTS.com is also a good site (along with this one).

    Cheers!

Viewing 11 posts - 1 through 10 (of 10 total)

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