SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Querry


Querry

Author
Message
BuilderBits
BuilderBits
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2713 Visits: 251

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!
Ray M
Ray M
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11745 Visits: 1076

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


BuilderBits
BuilderBits
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2713 Visits: 251

Ok,

Thanks,

Erik..



Dam again!
bellis
bellis
SSCrazy
SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)

Group: General Forum Members
Points: 2003 Visits: 6
Select "Design Table" and then you will be able to add a column to the table definition



BuilderBits
BuilderBits
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2713 Visits: 251

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!
bellis
bellis
SSCrazy
SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)

Group: General Forum Members
Points: 2003 Visits: 6

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.





BuilderBits
BuilderBits
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2713 Visits: 251

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

Seriousl,

Thanks.



Dam again!
bellis
bellis
SSCrazy
SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)

Group: General Forum Members
Points: 2003 Visits: 6
Never looked at it like that, but that's a great outlook on life. I'm going to try to use that myself.



bellis
bellis
SSCrazy
SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)

Group: General Forum Members
Points: 2003 Visits: 6

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





BuilderBits
BuilderBits
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2713 Visits: 251

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!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search