Showing posts with label existing. Show all posts
Showing posts with label existing. Show all posts

Wednesday, March 21, 2012

how can I add a unique key column to a table and generate its values automatically?

Hi, all,

I have a question about adding a unique key column to an existing table.

what i trying to do is that: I have already created a table, now i wanna add a ID column to this table, and generate the values for ID column from 1 to the existing row number. How can I get this done?

Thanks a lot in advance for any guidance.

Here is an example of how to add an identity column

create table TestID (SomeField varchar(49))
insert into TestID values ('1.1.9')
insert into TestID values ('2.2.2.10')
insert into TestID values ('2.2.2.8')
insert into TestID values ('2.2.2.9')
insert into TestID values ('1.1.7')
insert into TestID values ('1.1.8')
insert into TestID values ('1.2.1')
insert into TestID values ('1.1.1')
insert into TestID values ('1.1.10')
insert into TestID values ('1.1.10')
GO
select * from TestID
GO

alter table TestID add IdField int identity not null
Go
select * from TestID
GO

Denis the SQL Menace

http://sqlservercode.blogspot.com/

|||

Hi, thanks a lot.

Got it done, but the problem is: the new added identity column is not in order? like its values from 1 to 82 is actually not in the order, it is sorted out based on other columns values in the existing table. So how can I modify its values from 1 to 83 in the oder?

Thanks a lot.

|||Order is never guaranteed for a table, use ORDER BY to get the rows back in the order that you want|||Hi, thanks a lot.

Monday, March 19, 2012

How can connect SSAS w/o domain trusted connection?

I got error: An existing connection was forcibly closed by the remote host!!

string connstr = "Provider=MSOLAP.3;Data Source=amsserver;Password=;User ID=administrator;Initial Catalog=MIP2ASProject";

Client in XP, with AS9.0 provider installed, server is sqlserver 2005 in win2003 xp1.

Both machines are not under domain controller...

Moving to SQL Server Analysis Services forum.|||

Analysis Services does not support non-Windows authentication when connecting through TCP/IP.

You should be able to setup HTTP connectivity to SSAS.
See following:
http://www.microsoft.com/technet/prodtechnol/sql/2005/httpasws.mspx

And then use different type of authentication avaliable in IIS to connect to Analysis Server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.


Sunday, February 19, 2012

Hostname

What are the potential problems, what needs to be reconfigured, etc. if I
changed the servername on an existing SQL server box?
Dear morphius,
On the Server side, for normal operations, nothing is required to be changed!
If you have linked servers, you may need to reconfigure servers and modify
views that link the servers.
If you have replication that use complex SQL commands, server name that used
in those command need to be changed.
Clients connected to the server must be noticed to connect the new server.
Regards,
Mohammad Daoud | Technical Development Manager | Mobile +962 79 999 65 85
Tel. +962 6 554 3721 | daoudm@.greatpbs.com
http://www.greatpbs.com| http://www.facebook.com/group.php?gid=18895609248/
"morphius" wrote:

> What are the potential problems, what needs to be reconfigured, etc. if I
> changed the servername on an existing SQL server box?

Hostname

What are the potential problems, what needs to be reconfigured, etc. if I
changed the servername on an existing SQL server box?Dear morphius,
On the Server side, for normal operations, nothing is required to be changed!
If you have linked servers, you may need to reconfigure servers and modify
views that link the servers.
If you have replication that use complex SQL commands, server name that used
in those command need to be changed.
Clients connected to the server must be noticed to connect the new server.
Regards,
Mohammad Daoud | Technical Development Manager | Mobile +962 79 999 65 85
Tel. +962 6 554 3721 | daoudm@.greatpbs.com
http://www.greatpbs.com|http://www.facebook.com/group.php?gid=18895609248/
"morphius" wrote:
> What are the potential problems, what needs to be reconfigured, etc. if I
> changed the servername on an existing SQL server box?

Hostname

What are the potential problems, what needs to be reconfigured, etc. if I
changed the servername on an existing SQL server box?Dear morphius,
On the Server side, for normal operations, nothing is required to be changed
!
If you have linked servers, you may need to reconfigure servers and modify
views that link the servers.
If you have replication that use complex SQL commands, server name that used
in those command need to be changed.
Clients connected to the server must be noticed to connect the new server.
Regards,
Mohammad Daoud | Technical Development Manager | Mobile +962 79 999 65 85
Tel. +962 6 554 3721 | daoudm@.greatpbs.com
http://www.greatpbs.com| http://www.facebook.com/group.php?gid=18895609248/
"morphius" wrote:

> What are the potential problems, what needs to be reconfigured, etc. if I
> changed the servername on an existing SQL server box?