Changing SP With The Changes In The Table

Jun 1, 2007

Hi All,

If the column names are changed , is there are a easy way to change the referred columns in the SP's. What I am doing is going into each SP and replace the old name with the new name.

Thank you for any help on this.




Necessity is the mother of all inventions!

View 18 Replies


ADVERTISEMENT

Changing Table Filegroups

Jun 18, 2002

I want to change the filegroup of a table. While we can do this in enterprise mgr, I would like to accomplish this in transact sql. We have a new configuration where the filegroups are located on different disks and to take advantage of that, I want to move the heavily accessed tables onto different groups. Example: table emp needs to be moved from filegroup Primary to file group Secondary.
please help...

View 1 Replies View Related

Changing Table Ownership

Jan 3, 2007

Hi,

Just want to ask that if it is possible to change a table ownership?

thanks

View 9 Replies View Related

Changing Table Format

Mar 11, 2004

Hi there,

Its probably easier to draw this problem than describe it, so here goes:

I have a sales forecast table (A,B,C are products [PRODUCT], the dates refer to the month for which the forecast is [FORECAST_DATE], and the integer is the forecast sales qty [FORECAST_QTY])

A 01/03/2004 30
B 01/03/2004 28
C 01/03/2004 24
A 01/04/2004 11
B 01/04/2004 09
C 01/04/2004 41

I need to convert the table into a more sensible format, like this:

(NB ...Dots are just there to help with formatting - basically I'm talking about a field for FORECAST_03_2004, FORECAST_04_2004 etc etc)


........ 01/03/2004....01/04/2004
A..........30..................11
B..........28..................09
C..........24..................41


I'm really no t-SQL guru, and I can't seem to get any joy out of BOL. It must only be a tiny bit of code. Can anyone help?

Thanks very much

Sam

View 4 Replies View Related

Changing Table Owner

Jul 20, 2005

Hi- apologies for asking a stupid newbie question, but I'm really stuck atthe moment. I need to change table ownership.I've got an asp script which is looking for a table owned by the dbo role,however the table was created under a different ownership. I understand theproblem, and almost understand the solution, but I can't seem to get all theway.THE PROBLEM (using [server].[database].[owner].[table])[mgbsvr1].[dnn].[dnnadmin].[aspsearch]needs to be[mgbsvr1].[dnn].[dbo].[aspsearch]I looked up the books online and found this syntax:sp_changeobjectowner [ @objname = ] 'object' , [ @newowner = ] 'owner'But I can't see how to use it, nor more importantly, where I should use it.It won't work in the query tool in Enterprise Manager. If I need to create ascript (which I've never done before), how do I execute the script?All help deeply appreciatedManning, Sydney

View 3 Replies View Related

Changing Column Name On A Table

Jul 20, 2005

Hi All,I am trying to change column name on an existing table. I am using SQLServer 7.As the table is quite big, it is taking quite long time to do it.By the way I could change the column name only through the EnterprizeManager.Is it possible to change the column name using SQL script?Why the change of column name will depend on the size of the table?Thanks for your answer.-Mokles

View 4 Replies View Related

Changing Table Selections

Mar 29, 2007

Hello,



I created a package using the import/export wizard in SSIS, that loads data from one database to the other. I am trying to find out how I can add and remove the tables that were originally selected when the package was created. I opened the package in BIDS, and I could not find that particular option. I know you can do this in 2000/DTS...



Any help would be appreciated...



Thank you,



David

View 2 Replies View Related

Impact Of Changing Primary Key On Table

Jul 3, 2001

Hi All,

I want to know what will be the impact of changing the primarykey on a table which already has a lot of data.

For example, column A is unique, primary key. I want to make column B as unique, primary key.

Can I do that? What will be the impact on database performance?

Thanks
Sri

View 1 Replies View Related

Changing Datatype In A Table Used For Replication ?

Feb 28, 2002

Changing datatype in a table used for merge replication ?

I'm trying to change the data type on a column in a table that is used for a merge-replication with another (identical) DB.

I get this error:
Cannot alter the table '[Tablename]' because it is being published for replication.

I've tried to remove that specific table from the publication (Publication properties -> Articles tab) so I can change the data type and then put the table back into the publication, but I can't (probably because it's a MERGE rep.)

Any ideas ?

/CN

View 1 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

Changing Column's Name In A Temp Table

Jul 10, 2007

Dear All,I'm trying to alter the name of several columns' in a table which gets created in a stored procedure.trying to use:exec sp_rename '#tblBd.week1', '2007_18', 'COLUMN'I get:Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 163Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.There is no mistype, the table name and column name are correct.Can temp table's column names not be altered?If yes, how?Thanks in advance!

View 7 Replies View Related

Changing The Structure Of Data In A Table

Feb 20, 2004

I have a table that looks like this:

ID Type
123 Phone
123 Meeting
123 Phone


and I would like the data to look like this

ID phone Meeting
123 2 1


How do I do this?

View 3 Replies View Related

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

Changing Column Order In A Table

Jul 20, 2005

This subject has been posted several times, but I haven't seen a goodanswer.Problem:I want to change the order of the columns in a table using T-SQL only.Explanation:After running your code, I want to see the following table...CREATE TABLE [dbo].[TableName] ([First_Column] [int] NULL ,[Second_Column] [varchar] (20) NULL) ON [PRIMARY]look like this...CREATE TABLE [dbo].[TableName] ([Second_Column] [varchar] (20) NULL ,[First_Column] [int] NULL) ON [PRIMARY]Limitations:Don't post if your post would fall in the following categories:1. If you don't think it can be done2. If you think Enterprise Manager is the only way to do this3. If you think I should just change the order of my Selectstatements4. If you want to state that order column doesn't matter in arelational database5. If you want to ask me why I want to do thisWish:Hopefully the answer WON'T involve creating a brand new table, movingthe data from old to new, dropping the old table, then renaming thenew table to the old name. Yes, I can do that. The table I'm workingwith is extremely huge -- I don't want to do the data juggling.Thanks in advance!

View 2 Replies View Related

Having Trouble Changing Destination Table Name

Mar 17, 2008

I created a package using the Import Data wizard and everything works fine when I re-execute it. I needed to change the name of the destination table so I went into SQL Server and renamed the table. I then went in and edited the DTSX file via a text editor and changed the OpenRowset setting from [CMBS].[dbo].[raw_Note] -> [CMBS].[dbo].[T_Raw_Note]

<property id="104" name="OpenRowset" dataType="System.String" state="default" isArray="false" description="Specifies the name of the database object used to open a rowset." typeConverter="" UITypeEditor="" containsID="false" expressionType="None">[CMBS].[dbo].[T_Raw_Note]</property>

There are no other references to the table in the DTSX, i saved the file and then re-ran.

When I run, I get invalid object name dbo.raw_Note (old table name). Is there some data being cached somewhere or hidden elsewhere that it would reference the old table? When I go back into the DTSX file, the correct name is in there so I don't know where it is getting the old name from? Any help would be appreciated.

Tim

View 3 Replies View Related

Changing Config Table Location On The Fly

Aug 30, 2007

Hi everyone,


I am trying to create a proof of concept to show that we can have packages deployed on 3 different servers and all we need to do is tell the package, upon execution/scheduled task, where to go fetch it's configurations from.

The configurations are using SQL Server as the package configuration. This makes it easier for DBA's to maintain since DBA's are responsible for package executions and job scheduling.

For example, the configuration database and all package configurations would be found on server1, server2 and server3 The difference in values is that on Server1, the configuration for the source data and the destination data point to Server1DatabaseSource and Server1DatabaseDestination and on server2, the configs point the source to Server2DatabaseSource and Server2DatabaseDestination and for server 3, the same thing but pointing to server3.

There is also a connection for the SSIS_Config database we're getting the configurations from. In theory, if we specify a different server where this SSIS_Config database is found, it should override the settings in the package. No?

When I schedule OR execute the package, it's always getting it's configs from the config specified in the package independent of wether I specify it in the Connection Managers of the Execute Package Utility when I manually execute it OR in the data sources tab when I configure the package to be run as a job in SQL Server 2005.

Am I missing something here?


Thanks,

Rob

View 12 Replies View Related

Changing The Dataset Of A Table Dynamically

May 1, 2007

Hi all,

Is there a way to change the dataset being used by a table dynamically ?

Regards,
Neil

View 2 Replies View Related

Changing A Primary Key In A Replicated Table

Jul 20, 2006

Hi

We have a merge publication - I want to change the primary key for one of the tables (add another column to the primary key)

How do I do it ?

Currently there is no data in the table - which I guess might help..

thanks
Bruce

View 3 Replies View Related

Changing MS SQL Server Express Table Properties

Jul 13, 2005

Hi,

I have a MS SQL Server Express database wich I upsized once from MS
Access. I can connect to it and get/insert data but I can't update the
field properties.

I've used Access 2003, Visual Studio .Net and SQL Server Web Data
Administrator, but I can't change the properties of existing tables. I
cán add new tables and add their properties afterwards. Since I have a
lot of tables it would be too much work too recreate them all. So how
can I edit my existing tables?

View 1 Replies View Related

Changing Table Props On Replicated Tables

Dec 13, 2001

How can I change a field size that is set to numerical 9,2 to 9,3? I need to allow 3 decimal places.

Thank you,
Kameron

View 2 Replies View Related

Changing Datatype: Smallint To Int In A Large Table..

Jul 13, 2004

Hi,

I need to change the datatype of a very large table from smallint to int...
What would be an ideal solution to get this done in least amount of time. May be I can try with ALTER but , I am not sure about the time it would take ...and the page splits etc..

pls help on the same!!

Thanks
Cheriyan.

View 14 Replies View Related

Changing Query To Point To DB Table But Has Errors

Aug 5, 2014

CREATE TABLE SampleData (
CoID nvarchar(255),
Company varchar(255),
FirstName varchar(255),
LastName varchar(255),
JobLevel varchar(255))

[Code] ....

I am trying to make changes to the above query. This query will select 2 records per Company with top down priority on JobLevel. For example: This query will select 2 records from "123 Inc", where they have 2 Managers and 3 Staff contacts. The return results selects (2) managers and no staff records and FirstName and LastName are not duplicate. Then for "A Small Co.", they have 1 VP, 1 Director, 1 Manager and 3 Staff contacts. the return results chooses 1 VP and 1 Director and no managers or staff level people. And so on and so forth for the remainder of the companies.

What I was trying to accomplish is having this same query point to the database tables instead creating a table each and every time. I have this data residing in our database. I tried to make the change so it would point to the database tables but it kept giving me errors. This is way more complex than I thought.

My failed attempt:

Select *
From CampServ.dbo.SampleFakeCustomerData
//This is where I am getting stuck
WITH Priorities(Priority, JobLevel) AS(
SELECT 1, 'VP' UNION ALL
SELECT 2, 'Director' UNION ALL

[Code] ....

View 2 Replies View Related

How To Fire A Trigger Without Changing Table Data

Mar 28, 2006

I have tables that I want to fire either an update or insert trigger on.I could write a script containing a long list of inserts but I'm looking forsomething simpler. Would isql work? Any special conditions to get it towork?I've tried tricks like 'update x set col = col' or 'update x set col = col +'' 'All the alternatives seem to have problems. Any ideas?----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups----= East and West-Coast Server Farms - Total Privacy via Encryption =----

View 5 Replies View Related

Prevent Other Users From Changing Data Of A Table

Sep 20, 2006

hi..

How do i prevent other users from changing the data of my tables? Means one can change data using only my login rest others cannot even DBA or also from server administrator

View 1 Replies View Related

Changing A Record After Comparing One Database Table To Another

May 26, 2007

I'm using SQL Server 2005 Express.



In my main database table I have many fields but the two following fields are my main concern.

1) email_address

2) unsubscribe



In my secondary database table I have one record only.

1) email_address



What I want to accomplish... I want to compare the email_address of the secondary database table to the email_address of the main database table and if it exist, change the value of the unsubscribe field. (or if I can't do that, then delete the record within the main database table completely.)



I'd really appreciate any help I can get.



Thanks,

Bill

View 3 Replies View Related

Changing Column Length Of A Replicated Table

Jul 31, 2006



Can I increase the length of a varchar column of table involved in transactional replication without dropping and recreating publication/subscription?

Any help/short-cuts/undocumented features greatly appreciated.

Regards

Opal

View 6 Replies View Related

DB Engine :: Changing ANSI PADDING On A Table

Aug 3, 2012

I have a question relating to the ANSI_PADDING setting on some existing tables in a SQL Server 2008 R2 database I am working with. When I generated the tables originally I basically programmatically created them by building CREATE scripts within my code. Since I did not explicitly set ANSI_PADDING to ON all these tables they seem to have been created with ANSI_PADDING as OFF. Some of these tables, which I now need to add columns to, contain varchar(n) and varbinary(n) columns.

When I try to alter the tables through Management Studio, SQL Server gives me a warning: "One or more tables have ANSI_PADDING 'off' and will be recreated with ANSI_PADDING 'on'" - this seems to be generated by the ALTER statement which by default sets ANSI_PADDING to ON. Another iteration of the same warning - "Columns have different ANSI_PADDING settings. New columns will be created with ANSI_PADDING 'on'".

From what I read regarding ANSI_PADDING it seems ON is definitely the way to go. I just need to know if changing the value may result in any of the existing data in the table to be changed or may have any other unintended side effect, as this may cause problems for me.

View 8 Replies View Related

Table Names Are Not Changing With Change In Schema Name

Aug 8, 2007

Hello Everyone,

I am working on a dtsx package wherein i am sending the data from OLE DB Source (SQL Server) to OLE DB Destination (Oracle). For development purpose i use DEVLOPMENT environment on oracle but for unit testing i have to use QA or Some other Schema. when i use DEVELOPMENT Schema in ole db destination, tables are accessed under Schema name eg. "DEVELOPMENT"."EMPLOYEE", but when i m chenging schema name to QA table names are not changing as "QA"."EMPLOYEE". Data Flow Task is pushing the data to DEVELOPMENT environment only.


Can Anyone suggest me any remedy for it ?
Or this is one more BUG in SQL Server 2005.


Advice and suggestions are highly appreciated !

Thanks

View 3 Replies View Related

Dynamic Group Changing In A Table Report

Nov 29, 2007



Hello all!
Does anybody know, if it is possilbe to dynamically change grouping in a table report?
I mean, is it possible to provide the enduser the capability to group data in a table on whatever column he would like?

The second question is related:
Is it possible to make a usersort on a grouped table, in such way, that ALL the rows would be sorted ascended regardless of the group they belong to? (For now the only way I see to do this is to give the enduser possibility to turn off grouping manually)

View 3 Replies View Related

Changing Column Values On Table Insert Trigger

Nov 7, 2006

Hello,i have a table and if a record is inserted i will test a numeric valuein this table. If the this value is greather as 1 million, than anstatus column should be changed from 'A' to 'B'.Yes and sorry, this is a newbie question.On Oracle this work simple:create trigger myTrigger on tableXasbeginif :old.x 100000 then:new.y:='B'end if;end;ThanksMaik

View 2 Replies View Related

Validating Start And End Dates In Slow Changing Dimension Table

May 4, 2007

Has anyone written or come across a routine that validates start and enddate in a slow changing dimension? (eg verifies there is no overlap in any of the records).



thanks in advance

View 3 Replies View Related

Exporting A Table With Changing Column Names To An Excel File

Oct 25, 2006

I'm trying to write an SSIS package that exports a table that has changing column names to an excel file. The column names change due to the fact that the table is created by a pivot daily. the only thing I'm missing is the ability to dynamically map the tables' columns to the excel destination. Is this possible?

I read in another thread that
"It is not possible to create packages or new objects within packages using SSIS."
I also read in the books online that "The input and the input columns of the Excel destination have no custom
properties." To me this means that I cannot programmatically create or remove columns in the excel destination. Please tell me I'm wrong.
So, to summarize my research so far. In writing an SSIS package, I cannot programmatically create a new excel destination object and I can't manipulate an existing one. I hope I'm wrong. Can anyone help me? (and please correct any wrong assumptions I may have stated)

View 2 Replies View Related

Keeping A Remote Table Current. Slowly Changing Dimension?? Thank You

Feb 6, 2008



Somebody suggested I use the slowly changing dimension object to keep a table current between servers and databases.

I have two databases servers. One 2000 and the other 2005. I was told because security reasons I should not link them

The two tables are not identical. The destination table only has a handle of the columns and in some cases columns are not the same size.


Once a day. When new rows are introduced in the source table, I'd like to introduce those rows into the destination table. When rows are modified, I'd like to apply changes to the distination table.

I started playing with the slowly changing dimensions object, but am frankly confused connected the dots. Will I have an output oledb object for each command object?

Am i using the right the object for objective?

Are there any good tutorials or videos out there that will cover this?

Thanks for any help or information!

View 4 Replies View Related







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