Showing posts with label position. Show all posts
Showing posts with label position. Show all posts

Saturday, February 25, 2012

column position sql table

There are about 500 tables in one particular datbase. There areforeign keys set on most of the tables. I want to change the positionof the primary key column in all those tables. How can I do thatprogramatically?

What do you mean by "position" of the PK column?

|||

PK = primary key

|||

Let me rephrase my question:

What do you mean by"position" of the PK column?

|||

Hi dilbert1947,

Based on my understanding, if you mean "the column sequence number" for "the position of the primary key column", then i think there is nothing you have to worry about. In my opinion, changing the column sequence of your primary key won't affect anything in your database schema.

Hope my suggestion can help

|||

Ok let me put it this way. I had to add a primary key column (programmatically) to all the tables in a database. Now when you right click and view the table, you see the newly added primary key column as the right most column. After the primary key column was added, many foreign keys were also added in many of the tables. Now one way to change the column "position" is to manually right click on each table and click modify and then manually move the column to the top, so that every time you view the table, the primary key column appears on the left. Myself being a lazy person, I'd lprefer to write code that would do this in all the tables rather than manually modifying all the tables.

I hope that makes things clear.

|||

Do it manually in one of the tables. Then before you save the changes, click the button that says "Generate change SQL file" or something like that. Then read the file and see what the tool was going to execute.

Sunday, February 12, 2012

Collocating

Hello : )
This Thursday 21st, I have a second interview for a DBA position. I have
been looking for an opportunity like this for awhile now and I hope I don't
blow it.
My question is regarding replication/synching for SQL Servers at different
locations. One of the first tasks (if I am hired) will be to find a location
to install and set up redundant SQL Servers. The reason they want to do this
is because they recently had an extended power loss and their servers where
down for several hours.
I am sure I will be asked during the interview how I will go about doing
this. Does anyone have any advice on how to answer?
I have been working with single Production servers at several companies over
the past 7 years, but
I have no expirence with collocation, and only "playing around" expierence
with replication. I am not afraid of this task and am looking forward to a
challange like this.
I want to be sure that I answer the question intellegently.
Thanks in advance for your support!
Aaron
Key points:
Replication is not always a good way to implement disaster recovery...it
makes changed to your database and servers (as well as adding a whole new
layer of DBA effort)
Log shipping is an option (easy if you have Enterprise Edition)
3rd party tools such as Double-take from http://www.nsisoftware.com/ may
also be an option.
It really depends on their tolerance for downtime, willingness to pay for a
solution and size of the database (its much easier to set up DR for 20mb
than 20TB)
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
www.DallasDBAs.com/forum - new DB forum for Dallas/Ft. Worth area DBAs.
www.experts-exchange.com - experts compete for points to answer your
questions
"Next" <aeverett99@.newsgroup.nospam> wrote in message
news:904B5E63-ACB4-4CE1-9986-36C9F9698ACC@.microsoft.com...
> Hello : )
> This Thursday 21st, I have a second interview for a DBA position. I have
> been looking for an opportunity like this for awhile now and I hope I
> don't
> blow it.
> My question is regarding replication/synching for SQL Servers at different
> locations. One of the first tasks (if I am hired) will be to find a
> location
> to install and set up redundant SQL Servers. The reason they want to do
> this
> is because they recently had an extended power loss and their servers
> where
> down for several hours.
> I am sure I will be asked during the interview how I will go about doing
> this. Does anyone have any advice on how to answer?
> I have been working with single Production servers at several companies
> over
> the past 7 years, but
> I have no expirence with collocation, and only "playing around" expierence
> with replication. I am not afraid of this task and am looking forward to a
> challange like this.
> I want to be sure that I answer the question intellegently.
> Thanks in advance for your support!
> Aaron
>