Changing Column Size In Existing Databese?

Jul 20, 2005

I must increase column (filed) size in existing datebase but without using
Enterprise manager....(Becouse we use MSDE on our clients PCs)
The Filed is part of primary and foreign key constraints....
And every constraint has diferent index number in each database...
for example (PK_something_9e382hjl8), and I don't know how to pick this
value before "drop constraint" command.....

Thank you very much....

View 1 Replies


ADVERTISEMENT

Changing Table Column Size

Mar 2, 2004

I'm new to mssql.

I need to change the size of a column of a table from char(255) to char(500). I used the line:

alter table table_name alter column column_name char(500)

When I run that command, I get a message that it was sucessful. However, when I try to enter data into the changed column, the number of characters I can enter is still 255. I check the information schema for the column and the 'character_maximum_length' field is 500.

What is the problem here? Is the maximum allowable length for char 255? How can I get a column to have 500 characters?

View 6 Replies View Related

SQL 2012 :: Varchar - Changing Text Column Size

Aug 7, 2015

Impact on performance of changing Text column size.

However, many of them were regarding older releases of SQL Server.

Does the architecture in 2012, 2014 releases make this less of an issue ?

In other words, why bother going from Varchar(1000) to Varchar(50) ?

I'm just thinking maybe there is column compression automatically now.

View 4 Replies View Related

SQL 2012 :: Existing Replica MDF File Size Increased In Size Than New Replica Install

Apr 14, 2015

Here are my scenarios:

We have an application with replicated environment setup on sql server 2012 . Users will have a replica on their machines and they will replicate to the master database. It has 3 subscriptions subscribed to the publications on the master db.

1) We set up a replica(which uses sql server 2012) on a machine with no sql server on it. After the initial synchronization(used replmerge tool) the mdf file has grown to 33gigs and ldf has grown to 41 gigs. I went to sql server management studion . Right click and checked the properties of the local database. over all size is around 84 gb with little empty free space available.

2) We set up a replica(which uses sql server 2012) on a machine with sql server 2008 on it. After the initial synchronization(used replmerge tool) the mdf file has grown to 49 gigs and ldf has grown to 41 gigs. I went to sql server management studio , Right click and checked the properties of the local database. over all size is around 90 gb with 16 gb free space available.

3) We set up a replica(which uses sql server 2012) on a machine with sql server 2012 on it. We have dropped the local database and recreated the local db and did the initial synchronization using replmerge tool. The mdf file has grown to 49 gigs and ldf has grown to 41 gigs. I went to sql server management studio , Right click and checked the properties of the local database. over all size is around 90 gb with 16 gb free space available.

Why it is allocating the space differently? This is effecting our initial replica set up times.

View 0 Replies View Related

Changing Field Name Of An Existing Table

Jan 17, 2006

Hi,
Is it possible to change any fieldname of an existing table?I mean to say
by TSQL statement.We know that we can alter the data type and width etc.
But I haven't got any info about filedname change.So if it is possible
Please help...
And Is there any TSQL command to alter multiple columns in a single statement?

Please help...
Thanks!!
Joydeep

View 7 Replies View Related

Question: Changing Case On Existing Records

Jul 23, 2005

Greetings:I have a SQL 2000 database, in which about 1% of the records are inlower case. I need to make them UPPER CASE.Is there a function to determine and change the case of existingrecords, or will I have to re-write the records manually?Thanks,DW

View 6 Replies View Related

Changing Data Source Of Existing Cube

Dec 25, 2006

Hi Guys,

We had existing cubes in our Analysis Server, we were required to move them on another Reporting Server which would be using Data Replicated every night to that server. Problem is now source data is divided into 2 Reporting Database Servers. Table Names/View Names are the same in all the Databases. I just want to change the data source pointing to existing Database to the new Reporting Server. Can you tell me how this can be achieved?

Regards,

Kaushal



View 3 Replies View Related

Integration Services :: Add New Column Based On Existing Column Using Derived Column Task?

Jul 28, 2015

I have a excel file which has a column called "Code" and their values are A,B,C,D,E,F,G,H.  I want to create a new column called "status" based on the values of "Code".

Code:

A
B
C
D
E
F
G
H

If A,C,E,G then "status" = "Active" else if  B,D,F,H then "Status" = "Inactive". I like to do it using "Derived Column".

View 4 Replies View Related

SQL Server 2008 :: Changing Large / Existing Table To Sparse Columns?

Sep 21, 2015

I have some huge tables (think 200+GB for a single table) which are excellent candidates for sparse columns. The tables have many columns which are defined with decimal datatypes (13,2) with a large percentage of them (over 50% in most cases- some as much as 99%) being 0.00. Since this is very expensive in terms of storage my idea is to set all the 0.00 values equal to NULL then set them as sparse. Across 100 or so identical databases, I have 5 such tables, with 20-40 columns in each table.

1.) three steps for each column in each table in each db.

Step 1: update table to allow for nulls

Step 2: update tabe set column=null where column =0.00

Step 3 update table set sparse columns

2.)

Step 1: Create entirely new table with sparse column definitions

Step 2: copy entire table, transforming 0.00 to null for affected columns via SSIS

Step 3: drop original table, rename new table to original name

View 0 Replies View Related

Existing Backup File Kept Growing In Size.

Jan 3, 2007

I'm having a problem. When I use the SQL query to make a backup of the database, it worked fine. But everytime I use it, the backed-up file's size kept growing in size. Say I have the file, test.bak whose filesize is 450 MB then I run a new backup to overwrite the existing test.bak file, it just end up as 900 MB. If I run it again, it become 1350 MB and so on.

Is there a way to prevent that from happening?

View 1 Replies View Related

Whqt Is The TSQL Statement To Make A Backup Of A Specific Databese??

May 10, 2008

i have a database names "students" in SQL server 2000. is there any TSQL statement to make a backup of the student databse in to a sspecific location ??????????

pls help

View 4 Replies View Related

Changing Log File Size

Dec 14, 2001

Greetings,

I want to increase the size of a transaction log file. Can I do this while the database is live? If not, what do I need to do?

Thanks!

Rob

View 2 Replies View Related

Changing The Size Of Tempdb

Jan 17, 2001

We currently have a hard-drive size of 3.89MB and 3.3MB is being used by tempdb. I have tried shrinking the database truncateonly but this is not working. The problem is that the tempdb file is as large as my C: drive size. In addition can this be moved to another directory. For example can I move the tempdb.mdf and ldf from C: to E:. Any help would be greatly appreciated.

Thanks

View 1 Replies View Related

Changing Value Of Initial Size (MB)

Dec 5, 2007

I would like to increase the initial size of a SQL 2005 DB from 150 to 250 GB to prevent automatic autogrowth; would this have any impact in production if you do it on the fly?

Thanks,

Carlos

View 3 Replies View Related

Changing The Log Initial Size

Jan 27, 2007

Folks:

Is there a way to decrease the initial size of a database/log file? I've noticed you can increase it, but if you decrease it, after you confirm the change and go checking again, you will see nothing happened.

Is there a way? Am I missing anything?!

View 4 Replies View Related

Changing Value Of Initial Size (MB)

Dec 5, 2007



I would like to increase the initial size of a SQL 2005 DB from 150 to 250 GB to prevent automatic autogrowth; would this have any impact in production if you do it on the fly?


Thanks,


Carlos

View 1 Replies View Related

Changing The Size Of A Varchar Field

Jul 7, 2006

We have a small table of about 13 million rows that needs altered. A column in the table needs to be changed from a varchar(20) to a varchar(500). When we ran the alter table script, 3 hrs later and it wasn't done running. Any suggestions on what we can do to speed up the process?


Thanks ahead of time
DMW


Edit:
We are running SQL Server 2000 and the db at the time was running in simple mood

View 1 Replies View Related

Changing The Command Buffer Size?

Feb 11, 2004

Is it possible to change the command buffer size??

I need to export data on demand to an excel spreadsheet via a stored procedure. The only way I know how to do this is through a bulk copy command; but my query is much to big for the buffer....

Thanks!!!

View 9 Replies View Related

Changing Footer Size On Last Page Only

Apr 29, 2008



Dear all,

I am having a problem with the footer in my SQL Reporting Services project. I am trying to print a disclaimer in a text box on the last page in the footer. I can get the text box in the footer just fine but as the disclaimer is quite a lengthly multi line text string the footer has to be enlarged in order to fit the whole text box in.

This causes a problem on all the other pages where even though the footer is not displayed on pages before the last page it still takes up space stopping other data from being displayed where the footer would normally be.

Is there a way for me to set the footer size to a default value all all pages except the last page? I just want to enlarge the footer to about 1.5" on the last page to print my disclaimer without effecting the other pages layout.

Many thanks in advance,

Trevor Keast

View 14 Replies View Related

Integration Services :: Error While Changing Field Size

Sep 10, 2015

I am loading from SQL Server 2008 to Access 2010 using SSIS. One of the columns in the table I am loading into is a Number datatype and Fieldsize is long integer. The values are being truncated, so I want to change the Fieldsize to DOUBLE.  However, when I do that I receive the error below. What should I do? I would like not to change my Windows registry.

This error can be caused by one of the following:

The maximum number of columns allowed in a table or the maximum number of locks for a single file is exceeded.

The indexed property of a field is changed from Yes (Duplicates OK) to Yes (No Duplicates) when duplicate data exists in the table.

An expression is not specified in the Expression property of a calculated field. 

If the maximum number of locks per file was exceeded, you can increase the number by editing a registry entry. However, this is not a recommended option.

If you use Registry Editor incorrectly, you could cause serious problems that require you to reinstall the operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Make a backup of the registry. Find the MaxLocksPerFile registry value by using the Windows Registry Editor, and then increase the value. The MaxLocksPerFile value is saved as part of the following key:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice14.0Access Connectivity EngineEnginesACE

If the Indexed property of a field and duplicate data is located in the table, reset the Indexed property to the previous setting, or remove duplicate records from the table.

While I was loading to the same table a few days ago, I received a warning and the task took approx 9 hours. I am attaching the screen shot.

View 8 Replies View Related

Making An Existing Column An Identity Column

Mar 5, 2004

Hi,

I have a column that is unique that I would like to make into an IDENTITIY column after I insert some data into it.

I tried

alter table <table_name>
alter column <col_name> int Identity (1,1)

but it fails.


Ajay

WORD4LIFE
(http://www.word4life.com)

View 2 Replies View Related

Adding Column To A Table Before An Existing Column

Mar 30, 2004

I simply need the ability using SQL to add columns in an existing table before (or after) columns that already exist.

The MS SQL implementation of ALTER TABLE doesn't seem to provide the before or after placement criteria I require. How is this done in MS SQL using SQL or is there a stored procedure I can use?

Thanks.

View 5 Replies View Related

To Make An Existing Column Become An Identity Column

Jul 20, 2005

Hi(SQL Server 2000)I have an existing table (t) with a column that is NOT an identity column(t.ID), but it has manually inserted "row numbers". I want to make thiscolumn become an identity column. This column is a key field to othertables, so I want to keep the row numbers that are allready inserted.From the Query Analyzer, how do I do this?Thanks in advance!Regards,Gunnar VøyenliEDB-konsulent asNORWAY

View 3 Replies View Related

Reporting Services :: Change Column Size Dynamically Depends On Content Of The Column?

Jun 4, 2015

How to change column size dynamically depends on content of the column.

View 2 Replies View Related

SQL Set Primary Key On Existing Column

Nov 28, 2007

Hi everyone,How do I set a primary key on an existing column using SQL statements? I have column persID of type int in table employees. How do I correctly apply the ALTER command to change persID type to INT IDENTITY(1,1) NOT NULL?  Thanks in advance   

View 5 Replies View Related

Add A Column To Existing Script

Jan 6, 2014

Using Banner and Oracle DB. I have to add pay id to an existing script. One of the table names that pay id exists on is phrhist. I want to add phrhist_pict_code, phrhist_payno to the existing sql below:

select distinct spriden_id as GWID, spriden_last_name as LAST_NAME, spriden_first_name as FIRST_NAME, x.pdrdedn_amount1 as Amount,
x.pdrdedn_bdca_code as BDCA_CODE, x.pdrdedn_ref_no as REF_NO, x.pdrdedn_status as STATUS, x.pdrdedn_effective_date as Eff_Date, pebempl_ecls_code as ECLS
from spriden, pebempl, pdrdedn x, pdrbded, spbpers
where spriden_pidm = pebempl_pidm

[Code] ....

View 3 Replies View Related

How Can I Add A Column To An Existing Table

Nov 14, 2007

Hi everyone!

I just started with SQL and SQL Server 2005. I cantfind in my books how to add a column to an existing table. It should be a primary key, auto_increment column.

Hope someone can help, many thanks in advance

Greetings from Vienna Austria

landau

View 2 Replies View Related

Checking For Existing Column

Mar 1, 2006

Hi,I have a table which I want to alter to add the data from anothertable.Now both these tables have a few columns which are same. Now,I want the system to be such that only the unique columns can beadded to the first table.How can I accomplish this in SQL?

View 1 Replies View Related

Add SQL Count Column To Existing Table

Apr 22, 2008

I have a table for blog comments I want to add a column that counts the number of comments for each article.
existing table looks like this:
CommentID
ArticleID (FK)
commentAuthor
authorEmail
comment
commentDate (getDate())
I would like to add a column that counts the number of total comments for each article.This will give me what I want using the VS query tool:
"SELECT COUNT(comment) AS Expr1 FROM UserComments WHERE (articleid = @articleid)"
But can I add that to the table somehow so it does it automagically???

View 5 Replies View Related

Inserting A Column In An Existing Table

Mar 5, 2004

I have an existing table (see below).

-----------
[FormCode] [varchar] (4) NULL ,
[FiscalYear] [char] (4) NULL
-----------

I want to add the column below after the [FormCode] when my SPROC runs.
-----------
[FiscalMonth] [char] (2) NULL
-----------

Any ideas would be a big help?
TIF

View 7 Replies View Related

How Alter Only Datatype For Existing Column

Oct 24, 2007

I Have table Emp contains 3 columns one column is EName that datatype is char. now I want to change char to Varchar(4) . but column is primary key . and it is refernced by othertable columns .


i write query
alter table emp alter column ename varchar(4)
but it throws an error is
Msg 5074, Level 16, State 1, Line 1
The object 'PK_emp is dependent on column 'Ename'.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE ALTER COLUMN ename failed because one or more objects access this column.

please help me
asap.
Regards
Swamy

View 6 Replies View Related

SQL2005 Data Import Error, Unicode Data Is Odd Byte Size For Column &&<n&&>. Should Be Even Byte Size

Aug 23, 2006

Hi, I have a problem importing data from SQL Server 2000 'text' columns to SQL Server 2005 nvarchar(max) columns. I get the following error when encountering a transfer of any column that matches the above.
The error is copied below,

Any help on this greatly appreciated...

ERROR : errorCode=-1071636471 description=An OLE DB error has occurred. Error code: 0x80004005.An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Unicode data is odd byte size for column 3. Should be even byte size.". helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC} (Microsoft.SqlServer.DtsTransferProvider)


Many thanks

View 5 Replies View Related

Adding A Default Constraint To An Existing Column

Mar 9, 2000

I cannot figure out how to add a default constraint to an existing column. The syntax I'm using is :

ALTER TABLE table_name WITH NOCHECK
ADD CONSTRAINT column_name DEFAULT (0)

This gives me a syntax error.

The column was originally added with a default constraint of 1 to a 2.6 million row table.
I dropped the existing constraint and need to add the new default constraint of 0 for that column.

Anyone have any ideas? Thanks in advance.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved