If Already Altered
Feb 6, 2008
hi everyone...
how could i execute this query if the hrsrate is not yet altered to money. The original datatype is numeric(9,2)
Alter table hrEmpLeaveMonetize alter column hrsrate money
thanks
RON
________________________________________________________________________________________________
"I won't last a day without SQL"
View 1 Replies
Jun 7, 2001
Hi All,
Just want to know if a column with IDENTITY can be altered. If yes, how?
I have a table with colum defined like this:
CREATE TABLE [dbo].[Test] (
[TestID] [int] IDENTITY (1, 1) NOT NULL ,
.......
Through ALTER TABLE script (I don't want to do it through Enterprise Manager) I want it to be like this:
CREATE TABLE [dbo].[Test] (
[TestID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
.......
I want the constrain "NOT FOR REPLICATION" done through ALTER TABLE script. Is that possible?
Please let me know with the syntax.
Thanks
Sri
View 1 Replies
View Related
Jun 7, 2001
Hi All,
Just want to know if a column with IDENTITY can be altered. If yes, how?
I have a table with colum defined like this:
CREATE TABLE [dbo].[Test] (
[TestID] [int] IDENTITY (1, 1) NOT NULL ,
.......
Through ALTER TABLE script (I don't want to do it through Enterprise Manager) I want it to be like this:
CREATE TABLE [dbo].[Test] (
[TestID] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL ,
.......
I want the constrain "NOT FOR REPLICATION" done through ALTER TABLE script. Is that possible?
Please let me know with the syntax.
Thanks
Sri
View 1 Replies
View Related
Feb 14, 2008
Working on partitioning a few large tables. One of the tables included a text column and the €śTEXTIMAGE_ON [PRIMARY]€? clause which would prevent the partitioning of this table. After some research we found that the data was legacy and no longer used. We updated the column on the affected rows to NULLS and altered the column to a VARCHAR(20)
When I attempted to run the ALTER TABLE SWITCH I encountered the error
Msg 4947, Level 16, State 1, Line 1
ALTER TABLE SWITCH statement failed. There is no identical index in source table 'LocalDeltanet.dbo.testresultsjoe' for the index 'PKIDX_testSummary' in target table 'LocalDeltanet.dbo.testresults_part'.
After a lot of grief and testing I determined that the message was bogus and the real issue is that the 'sys.tables' still has €ślob_data_space_id€? with a value of 1 for this table.
I created a copy of the table with the text column altered to varchar and one with just the varchar to begin with. After copying data from the original table, I tried to run the alter switch. It failed once again for the text column altered to varchar table, but it worked for the varchar from the start.
Since it appears that this value is causing my issues, is there anyway to update the table in place. I know I can BCP the data out, but that would take too long and would defeat the advantage of using the alter switch method.
BOL States:
The allow updates option is still present in the sp_configure stored procedure, although its functionality is unavailable in Microsoft SQL Server 2005 (the setting has no effect). In SQL Server 2005, direct updates to the system tables are not supported. This means we cannot update the table manually.
Thanks
View 1 Replies
View Related
Jun 19, 2015
we recently migrated from our in-house domain to the Enterprise domain. Everything went smooth except for the fact that I can no longer accept my dBs using my SA or my domain admin account. There is only 1 account I can get into the management studio with but it has no admin privileges, so I can't make any  password changes or add accounts. I don't have a test environment so kind of hesitant to experiment with our production system.
View 6 Replies
View Related