We have a requirement to change a user defined type from char(4) to vchar(4).
I was wondering whether there's a easier(quickest) method to do this as opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this type.
Thanks,
Manod
ALTER TABLE ...
ALTER COLUMN
The stored procedure, view, and function dependencies should not matter;
however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
and Defaults that may be created on this field.
If you use the database designer tool, EM will usually script out a new
table with all of the dependency drops and recreates, move all of the data,
and drop and rename the tables for you.
This is usually not the best way to do this, especially for very large
tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
good way to learn at least the details if not a poorer solution.
Sincerely,
Anthony Thomas
"sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:69e9c64b.0503090211.3552c797@.posting.google.c om...
We have a requirement to change a user defined type from char(4) to
vchar(4).
I was wondering whether there's a easier(quickest) method to do this as
opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this
type.
Thanks,
Manod
|||Thanks Anthony...I was hoping that there would be an easier option than going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas
|||Well, there is. As I stated before, if you use the Table Designer through
the EM, it will handle all of the scripting for you. It usually will just
do the creat, copy, drop, replace method, which can work, but it will take a
lot of resources to pull off on larger tables. The same could be done, just
do the same thing except save as script instead save. Keep the drop and
create dependencies, just replace the create, copy, and rename table pieces
with a single ALTER TABLE ... ALTER COLUMN statement. At leas this way, you
would have to parse the dependencies.
There is a caveat to this, however; the EM uses the sysdependencies to
script out all the drops and creates. If you have ever renamed an object
without dropping and recreating the dependencies, and have gotten that
little error message, this means the records in this system table have not
been updated to reflect the name change. So, the little wizard inside the
EM scripter will not catch everything...but your errors will.
Good luck.
Anthony Thomas
"Sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:15EEA5C6-8281-41FB-8287-085E1193F84F@.microsoft.com...
Thanks Anthony...I was hoping that there would be an easier option than
going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the
data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas
Showing posts with label easier. Show all posts
Showing posts with label easier. Show all posts
Sunday, March 11, 2012
Change user type from char to vchar
We have a requirement to change a user defined type from char(4) to vchar(4)
.
I was wondering whether there's a easier(quickest) method to do this as oppo
sed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this ty
pe.
Thanks,
ManodALTER TABLE ...
ALTER COLUMN
The stored procedure, view, and function dependencies should not matter;
however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
and Defaults that may be created on this field.
If you use the database designer tool, EM will usually script out a new
table with all of the dependency drops and recreates, move all of the data,
and drop and rename the tables for you.
This is usually not the best way to do this, especially for very large
tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
good way to learn at least the details if not a poorer solution.
Sincerely,
Anthony Thomas
"sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:69e9c64b.0503090211.3552c797@.posting.google.com...
We have a requirement to change a user defined type from char(4) to
vchar(4).
I was wondering whether there's a easier(quickest) method to do this as
opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this
type.
Thanks,
Manod|||Thanks Anthony...I was hoping that there would be an easier option than goin
g
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the data
,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas|||Well, there is. As I stated before, if you use the Table Designer through
the EM, it will handle all of the scripting for you. It usually will just
do the creat, copy, drop, replace method, which can work, but it will take a
lot of resources to pull off on larger tables. The same could be done, just
do the same thing except save as script instead save. Keep the drop and
create dependencies, just replace the create, copy, and rename table pieces
with a single ALTER TABLE ... ALTER COLUMN statement. At leas this way, you
would have to parse the dependencies.
There is a caveat to this, however; the EM uses the sysdependencies to
script out all the drops and creates. If you have ever renamed an object
without dropping and recreating the dependencies, and have gotten that
little error message, this means the records in this system table have not
been updated to reflect the name change. So, the little wizard inside the
EM scripter will not catch everything...but your errors will.
Good luck.
Anthony Thomas
"Sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:15EEA5C6-8281-41FB-8287-085E1193F84F@.microsoft.com...
Thanks Anthony...I was hoping that there would be an easier option than
going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the
data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas
.
I was wondering whether there's a easier(quickest) method to do this as oppo
sed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this ty
pe.
Thanks,
ManodALTER TABLE ...
ALTER COLUMN
The stored procedure, view, and function dependencies should not matter;
however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
and Defaults that may be created on this field.
If you use the database designer tool, EM will usually script out a new
table with all of the dependency drops and recreates, move all of the data,
and drop and rename the tables for you.
This is usually not the best way to do this, especially for very large
tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
good way to learn at least the details if not a poorer solution.
Sincerely,
Anthony Thomas
"sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:69e9c64b.0503090211.3552c797@.posting.google.com...
We have a requirement to change a user defined type from char(4) to
vchar(4).
I was wondering whether there's a easier(quickest) method to do this as
opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this
type.
Thanks,
Manod|||Thanks Anthony...I was hoping that there would be an easier option than goin
g
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the data
,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas|||Well, there is. As I stated before, if you use the Table Designer through
the EM, it will handle all of the scripting for you. It usually will just
do the creat, copy, drop, replace method, which can work, but it will take a
lot of resources to pull off on larger tables. The same could be done, just
do the same thing except save as script instead save. Keep the drop and
create dependencies, just replace the create, copy, and rename table pieces
with a single ALTER TABLE ... ALTER COLUMN statement. At leas this way, you
would have to parse the dependencies.
There is a caveat to this, however; the EM uses the sysdependencies to
script out all the drops and creates. If you have ever renamed an object
without dropping and recreating the dependencies, and have gotten that
little error message, this means the records in this system table have not
been updated to reflect the name change. So, the little wizard inside the
EM scripter will not catch everything...but your errors will.
Good luck.
Anthony Thomas
"Sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:15EEA5C6-8281-41FB-8287-085E1193F84F@.microsoft.com...
Thanks Anthony...I was hoping that there would be an easier option than
going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the
data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas
Change user type from char to vchar
We have a requirement to change a user defined type from char(4) to vchar(4)
.
I was wondering whether there's a easier(quickest) method to do this as oppo
sed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this ty
pe.
Thanks,
ManodALTER TABLE ...
ALTER COLUMN
The stored procedure, view, and function dependencies should not matter;
however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
and Defaults that may be created on this field.
If you use the database designer tool, EM will usually script out a new
table with all of the dependency drops and recreates, move all of the data,
and drop and rename the tables for you.
This is usually not the best way to do this, especially for very large
tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
good way to learn at least the details if not a poorer solution.
Sincerely,
Anthony Thomas
"sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:69e9c64b.0503090211.3552c797@.posting.google.com...
We have a requirement to change a user defined type from char(4) to
vchar(4).
I was wondering whether there's a easier(quickest) method to do this as
opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this
type.
Thanks,
Manod|||Thanks Anthony...I was hoping that there would be an easier option than goin
g
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the data
,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas|||Well, there is. As I stated before, if you use the Table Designer through
the EM, it will handle all of the scripting for you. It usually will just
do the creat, copy, drop, replace method, which can work, but it will take a
lot of resources to pull off on larger tables. The same could be done, just
do the same thing except save as script instead save. Keep the drop and
create dependencies, just replace the create, copy, and rename table pieces
with a single ALTER TABLE ... ALTER COLUMN statement. At leas this way, you
would have to parse the dependencies.
There is a caveat to this, however; the EM uses the sysdependencies to
script out all the drops and creates. If you have ever renamed an object
without dropping and recreating the dependencies, and have gotten that
little error message, this means the records in this system table have not
been updated to reflect the name change. So, the little wizard inside the
EM scripter will not catch everything...but your errors will.
Good luck.
Anthony Thomas
"Sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:15EEA5C6-8281-41FB-8287-085E1193F84F@.microsoft.com...
Thanks Anthony...I was hoping that there would be an easier option than
going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the
data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas
.
I was wondering whether there's a easier(quickest) method to do this as oppo
sed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this ty
pe.
Thanks,
ManodALTER TABLE ...
ALTER COLUMN
The stored procedure, view, and function dependencies should not matter;
however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
and Defaults that may be created on this field.
If you use the database designer tool, EM will usually script out a new
table with all of the dependency drops and recreates, move all of the data,
and drop and rename the tables for you.
This is usually not the best way to do this, especially for very large
tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
good way to learn at least the details if not a poorer solution.
Sincerely,
Anthony Thomas
"sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:69e9c64b.0503090211.3552c797@.posting.google.com...
We have a requirement to change a user defined type from char(4) to
vchar(4).
I was wondering whether there's a easier(quickest) method to do this as
opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this
type.
Thanks,
Manod|||Thanks Anthony...I was hoping that there would be an easier option than goin
g
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the data
,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas|||Well, there is. As I stated before, if you use the Table Designer through
the EM, it will handle all of the scripting for you. It usually will just
do the creat, copy, drop, replace method, which can work, but it will take a
lot of resources to pull off on larger tables. The same could be done, just
do the same thing except save as script instead save. Keep the drop and
create dependencies, just replace the create, copy, and rename table pieces
with a single ALTER TABLE ... ALTER COLUMN statement. At leas this way, you
would have to parse the dependencies.
There is a caveat to this, however; the EM uses the sysdependencies to
script out all the drops and creates. If you have ever renamed an object
without dropping and recreating the dependencies, and have gotten that
little error message, this means the records in this system table have not
been updated to reflect the name change. So, the little wizard inside the
EM scripter will not catch everything...but your errors will.
Good luck.
Anthony Thomas
"Sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:15EEA5C6-8281-41FB-8287-085E1193F84F@.microsoft.com...
Thanks Anthony...I was hoping that there would be an easier option than
going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the
data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas
Change user type from char to vchar
We have a requirement to change a user defined type from char(4) to vchar(4).
I was wondering whether there's a easier(quickest) method to do this as opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this type.
Thanks,
ManodALTER TABLE ...
ALTER COLUMN
The stored procedure, view, and function dependencies should not matter;
however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
and Defaults that may be created on this field.
If you use the database designer tool, EM will usually script out a new
table with all of the dependency drops and recreates, move all of the data,
and drop and rename the tables for you.
This is usually not the best way to do this, especially for very large
tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
good way to learn at least the details if not a poorer solution.
Sincerely,
Anthony Thomas
"sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:69e9c64b.0503090211.3552c797@.posting.google.com...
We have a requirement to change a user defined type from char(4) to
vchar(4).
I was wondering whether there's a easier(quickest) method to do this as
opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this
type.
Thanks,
Manod|||Thanks Anthony...I was hoping that there would be an easier option than going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas|||Well, there is. As I stated before, if you use the Table Designer through
the EM, it will handle all of the scripting for you. It usually will just
do the creat, copy, drop, replace method, which can work, but it will take a
lot of resources to pull off on larger tables. The same could be done, just
do the same thing except save as script instead save. Keep the drop and
create dependencies, just replace the create, copy, and rename table pieces
with a single ALTER TABLE ... ALTER COLUMN statement. At leas this way, you
would have to parse the dependencies.
There is a caveat to this, however; the EM uses the sysdependencies to
script out all the drops and creates. If you have ever renamed an object
without dropping and recreating the dependencies, and have gotten that
little error message, this means the records in this system table have not
been updated to reflect the name change. So, the little wizard inside the
EM scripter will not catch everything...but your errors will.
Good luck.
Anthony Thomas
"Sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:15EEA5C6-8281-41FB-8287-085E1193F84F@.microsoft.com...
Thanks Anthony...I was hoping that there would be an easier option than
going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the
data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas
I was wondering whether there's a easier(quickest) method to do this as opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this type.
Thanks,
ManodALTER TABLE ...
ALTER COLUMN
The stored procedure, view, and function dependencies should not matter;
however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
and Defaults that may be created on this field.
If you use the database designer tool, EM will usually script out a new
table with all of the dependency drops and recreates, move all of the data,
and drop and rename the tables for you.
This is usually not the best way to do this, especially for very large
tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
good way to learn at least the details if not a poorer solution.
Sincerely,
Anthony Thomas
"sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:69e9c64b.0503090211.3552c797@.posting.google.com...
We have a requirement to change a user defined type from char(4) to
vchar(4).
I was wondering whether there's a easier(quickest) method to do this as
opposed to:
- Drop dependent storedprocs and views
- rename type
- add type with new def
- reattach table columns
- drop old type
- recreate storedprocs,views
Yes, we have quite a few tables, storedproc and views that reference this
type.
Thanks,
Manod|||Thanks Anthony...I was hoping that there would be an easier option than going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas|||Well, there is. As I stated before, if you use the Table Designer through
the EM, it will handle all of the scripting for you. It usually will just
do the creat, copy, drop, replace method, which can work, but it will take a
lot of resources to pull off on larger tables. The same could be done, just
do the same thing except save as script instead save. Keep the drop and
create dependencies, just replace the create, copy, and rename table pieces
with a single ALTER TABLE ... ALTER COLUMN statement. At leas this way, you
would have to parse the dependencies.
There is a caveat to this, however; the EM uses the sysdependencies to
script out all the drops and creates. If you have ever renamed an object
without dropping and recreating the dependencies, and have gotten that
little error message, this means the records in this system table have not
been updated to reflect the name change. So, the little wizard inside the
EM scripter will not catch everything...but your errors will.
Good luck.
Anthony Thomas
"Sandiyan" <sandiyan@.yahoo.co.uk> wrote in message
news:15EEA5C6-8281-41FB-8287-085E1193F84F@.microsoft.com...
Thanks Anthony...I was hoping that there would be an easier option than
going
through and sorting out dependencies and etc...
I hope this will be addressed in sql2005 - my bet is not!
regards,
Sandiyan.
"Anthony Thomas" wrote:
> ALTER TABLE ...
> ALTER COLUMN
> The stored procedure, view, and function dependencies should not matter;
> however, you probably will have to drop and recreate any PKC, UC, FKC, CC,
> and Defaults that may be created on this field.
> If you use the database designer tool, EM will usually script out a new
> table with all of the dependency drops and recreates, move all of the
data,
> and drop and rename the tables for you.
> This is usually not the best way to do this, especially for very large
> tables, but you can "SAVE AS SCRIPT" instead of executing it. This is a
> good way to learn at least the details if not a poorer solution.
> Sincerely,
>
> Anthony Thomas
Saturday, February 25, 2012
Change Subtotal background color.
I created a Matrix report with subtotals.
It would be easier to read if the subtotals were shaded.
How do I shade the subtotal box. Not the lable box.
I can see the box labled totals and it is shaded it is the real total box
that I need to shade.
Thank you
Scott BurkeScott,
Using the inscope() function with the names of the matrix rows you are able
to tell when the row is a subtotal or not, then place the iif function in the
background color and sometimes the font color.
If you need more help I can find my code example. Last contract have to dig
it up.
Reeves
"Scott Burke" wrote:
> I created a Matrix report with subtotals.
> It would be easier to read if the subtotals were shaded.
> How do I shade the subtotal box. Not the lable box.
> I can see the box labled totals and it is shaded it is the real total box
> that I need to shade.
> Thank you
> Scott Burke|||Thanks for your time. However, Visual Sudioes has an error and shut down.
now the report I was working on is gone........
I will try your suggestion when I rebuild the report
Thanks again.
Scott Burke
"Reeves Smith" wrote:
> Scott,
> Using the inscope() function with the names of the matrix rows you are able
> to tell when the row is a subtotal or not, then place the iif function in the
> background color and sometimes the font color.
> If you need more help I can find my code example. Last contract have to dig
> it up.
> Reeves
>
> "Scott Burke" wrote:
> > I created a Matrix report with subtotals.
> >
> > It would be easier to read if the subtotals were shaded.
> >
> > How do I shade the subtotal box. Not the lable box.
> >
> > I can see the box labled totals and it is shaded it is the real total box
> > that I need to shade.
> >
> > Thank you
> > Scott Burke|||On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
wrote:
> Thanks for your time. However, Visual Sudioes has an error and shut down.
> now the report I was working on is gone........
> I will try your suggestion when I rebuild the report
> Thanks again.
> Scott Burke
> "Reeves Smith" wrote:
> > Scott,
> > Using the inscope() function with the names of the matrix rows you are able
> > to tell when the row is a subtotal or not, then place the iif function in the
> > background color and sometimes the font color.
> > If you need more help I can find my code example. Last contract have to dig
> > it up.
> > Reeves
> > "Scott Burke" wrote:
> > > I created a Matrix report with subtotals.
> > > It would be easier to read if the subtotals were shaded.
> > > How do I shade the subtotal box. Not the lable box.
> > > I can see the box labled totals and it is shaded it is the real total box
> > > that I need to shade.
> > > Thank you
> > > Scott Burke
Also, you could try an expression similar to this in the background
color property:
=iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
Where FieldName can be from an adjacent cell.
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Hi EMartinez,
I tried that but it did not work.
I tried the expression : =iif(Fields!textbox6.Value ='Total','lightgrey','transparent')
The box next to it is named "textbox6" with a value of
"Fields!magazinename.value"
The errror is "out of scope".
I am trying to referance the box name or the contents in the box?
Scott Burke
"EMartinez" wrote:
> On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> wrote:
> > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > now the report I was working on is gone........
> >
> > I will try your suggestion when I rebuild the report
> > Thanks again.
> > Scott Burke
> >
> > "Reeves Smith" wrote:
> > > Scott,
> >
> > > Using the inscope() function with the names of the matrix rows you are able
> > > to tell when the row is a subtotal or not, then place the iif function in the
> > > background color and sometimes the font color.
> >
> > > If you need more help I can find my code example. Last contract have to dig
> > > it up.
> >
> > > Reeves
> >
> > > "Scott Burke" wrote:
> >
> > > > I created a Matrix report with subtotals.
> >
> > > > It would be easier to read if the subtotals were shaded.
> >
> > > > How do I shade the subtotal box. Not the lable box.
> >
> > > > I can see the box labled totals and it is shaded it is the real total box
> > > > that I need to shade.
> >
> > > > Thank you
> > > > Scott Burke
>
> Also, you could try an expression similar to this in the background
> color property:
> =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> Where FieldName can be from an adjacent cell.
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||OK. I found the answear. Please try NOT to laught too loud. It will hurt
my feelings.
On the totals box there is an arrow in the upper right corner. If you click
on the arrow you will get the properties of the total box itself. Click
anywhere else in the box adn you get the properties of the subtotal label box.
Have fun over the weekend.
Scott Burke
"EMartinez" wrote:
> On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> wrote:
> > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > now the report I was working on is gone........
> >
> > I will try your suggestion when I rebuild the report
> > Thanks again.
> > Scott Burke
> >
> > "Reeves Smith" wrote:
> > > Scott,
> >
> > > Using the inscope() function with the names of the matrix rows you are able
> > > to tell when the row is a subtotal or not, then place the iif function in the
> > > background color and sometimes the font color.
> >
> > > If you need more help I can find my code example. Last contract have to dig
> > > it up.
> >
> > > Reeves
> >
> > > "Scott Burke" wrote:
> >
> > > > I created a Matrix report with subtotals.
> >
> > > > It would be easier to read if the subtotals were shaded.
> >
> > > > How do I shade the subtotal box. Not the lable box.
> >
> > > > I can see the box labled totals and it is shaded it is the real total box
> > > > that I need to shade.
> >
> > > > Thank you
> > > > Scott Burke
>
> Also, you could try an expression similar to this in the background
> color property:
> =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> Where FieldName can be from an adjacent cell.
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||Scott,
I'm not laughing as I did not even know that existed, thanks for the find.
Reeves
"Scott Burke" wrote:
> OK. I found the answear. Please try NOT to laught too loud. It will hurt
> my feelings.
> On the totals box there is an arrow in the upper right corner. If you click
> on the arrow you will get the properties of the total box itself. Click
> anywhere else in the box adn you get the properties of the subtotal label box.
> Have fun over the weekend.
> Scott Burke
> "EMartinez" wrote:
> > On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> > wrote:
> > > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > > now the report I was working on is gone........
> > >
> > > I will try your suggestion when I rebuild the report
> > > Thanks again.
> > > Scott Burke
> > >
> > > "Reeves Smith" wrote:
> > > > Scott,
> > >
> > > > Using the inscope() function with the names of the matrix rows you are able
> > > > to tell when the row is a subtotal or not, then place the iif function in the
> > > > background color and sometimes the font color.
> > >
> > > > If you need more help I can find my code example. Last contract have to dig
> > > > it up.
> > >
> > > > Reeves
> > >
> > > > "Scott Burke" wrote:
> > >
> > > > > I created a Matrix report with subtotals.
> > >
> > > > > It would be easier to read if the subtotals were shaded.
> > >
> > > > > How do I shade the subtotal box. Not the lable box.
> > >
> > > > > I can see the box labled totals and it is shaded it is the real total box
> > > > > that I need to shade.
> > >
> > > > > Thank you
> > > > > Scott Burke
> >
> >
> > Also, you could try an expression similar to this in the background
> > color property:
> > =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> > Where FieldName can be from an adjacent cell.
> > Hope this helps.
> >
> > Regards,
> >
> > Enrique Martinez
> > Sr. Software Consultant
> >
> >|||On Jun 1, 1:59 pm, Scott Burke <ScottBu...@.discussions.microsoft.com>
wrote:
> OK. I found the answear. Please try NOT to laught too loud. It will hurt
> my feelings.
> On the totals box there is an arrow in the upper right corner. If you click
> on the arrow you will get the properties of the total box itself. Click
> anywhere else in the box adn you get the properties of the subtotal label box.
> Have fun over the weekend.
> Scott Burke
> "EMartinez" wrote:
> > On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> > wrote:
> > > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > > now the report I was working on is gone........
> > > I will try your suggestion when I rebuild the report
> > > Thanks again.
> > > Scott Burke
> > > "Reeves Smith" wrote:
> > > > Scott,
> > > > Using the inscope() function with the names of the matrix rows you are able
> > > > to tell when the row is a subtotal or not, then place the iif function in the
> > > > background color and sometimes the font color.
> > > > If you need more help I can find my code example. Last contract have to dig
> > > > it up.
> > > > Reeves
> > > > "Scott Burke" wrote:
> > > > > I created a Matrix report with subtotals.
> > > > > It would be easier to read if the subtotals were shaded.
> > > > > How do I shade the subtotal box. Not the lable box.
> > > > > I can see the box labled totals and it is shaded it is the real total box
> > > > > that I need to shade.
> > > > > Thank you
> > > > > Scott Burke
> > Also, you could try an expression similar to this in the background
> > color property:
> > =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> > Where FieldName can be from an adjacent cell.
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
Glad you solved the problem. Let me know if I can be of greater
assistance.
Regards,
Enrique Martinez
Sr. Software Consultant
It would be easier to read if the subtotals were shaded.
How do I shade the subtotal box. Not the lable box.
I can see the box labled totals and it is shaded it is the real total box
that I need to shade.
Thank you
Scott BurkeScott,
Using the inscope() function with the names of the matrix rows you are able
to tell when the row is a subtotal or not, then place the iif function in the
background color and sometimes the font color.
If you need more help I can find my code example. Last contract have to dig
it up.
Reeves
"Scott Burke" wrote:
> I created a Matrix report with subtotals.
> It would be easier to read if the subtotals were shaded.
> How do I shade the subtotal box. Not the lable box.
> I can see the box labled totals and it is shaded it is the real total box
> that I need to shade.
> Thank you
> Scott Burke|||Thanks for your time. However, Visual Sudioes has an error and shut down.
now the report I was working on is gone........
I will try your suggestion when I rebuild the report
Thanks again.
Scott Burke
"Reeves Smith" wrote:
> Scott,
> Using the inscope() function with the names of the matrix rows you are able
> to tell when the row is a subtotal or not, then place the iif function in the
> background color and sometimes the font color.
> If you need more help I can find my code example. Last contract have to dig
> it up.
> Reeves
>
> "Scott Burke" wrote:
> > I created a Matrix report with subtotals.
> >
> > It would be easier to read if the subtotals were shaded.
> >
> > How do I shade the subtotal box. Not the lable box.
> >
> > I can see the box labled totals and it is shaded it is the real total box
> > that I need to shade.
> >
> > Thank you
> > Scott Burke|||On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
wrote:
> Thanks for your time. However, Visual Sudioes has an error and shut down.
> now the report I was working on is gone........
> I will try your suggestion when I rebuild the report
> Thanks again.
> Scott Burke
> "Reeves Smith" wrote:
> > Scott,
> > Using the inscope() function with the names of the matrix rows you are able
> > to tell when the row is a subtotal or not, then place the iif function in the
> > background color and sometimes the font color.
> > If you need more help I can find my code example. Last contract have to dig
> > it up.
> > Reeves
> > "Scott Burke" wrote:
> > > I created a Matrix report with subtotals.
> > > It would be easier to read if the subtotals were shaded.
> > > How do I shade the subtotal box. Not the lable box.
> > > I can see the box labled totals and it is shaded it is the real total box
> > > that I need to shade.
> > > Thank you
> > > Scott Burke
Also, you could try an expression similar to this in the background
color property:
=iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
Where FieldName can be from an adjacent cell.
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Hi EMartinez,
I tried that but it did not work.
I tried the expression : =iif(Fields!textbox6.Value ='Total','lightgrey','transparent')
The box next to it is named "textbox6" with a value of
"Fields!magazinename.value"
The errror is "out of scope".
I am trying to referance the box name or the contents in the box?
Scott Burke
"EMartinez" wrote:
> On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> wrote:
> > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > now the report I was working on is gone........
> >
> > I will try your suggestion when I rebuild the report
> > Thanks again.
> > Scott Burke
> >
> > "Reeves Smith" wrote:
> > > Scott,
> >
> > > Using the inscope() function with the names of the matrix rows you are able
> > > to tell when the row is a subtotal or not, then place the iif function in the
> > > background color and sometimes the font color.
> >
> > > If you need more help I can find my code example. Last contract have to dig
> > > it up.
> >
> > > Reeves
> >
> > > "Scott Burke" wrote:
> >
> > > > I created a Matrix report with subtotals.
> >
> > > > It would be easier to read if the subtotals were shaded.
> >
> > > > How do I shade the subtotal box. Not the lable box.
> >
> > > > I can see the box labled totals and it is shaded it is the real total box
> > > > that I need to shade.
> >
> > > > Thank you
> > > > Scott Burke
>
> Also, you could try an expression similar to this in the background
> color property:
> =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> Where FieldName can be from an adjacent cell.
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||OK. I found the answear. Please try NOT to laught too loud. It will hurt
my feelings.
On the totals box there is an arrow in the upper right corner. If you click
on the arrow you will get the properties of the total box itself. Click
anywhere else in the box adn you get the properties of the subtotal label box.
Have fun over the weekend.
Scott Burke
"EMartinez" wrote:
> On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> wrote:
> > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > now the report I was working on is gone........
> >
> > I will try your suggestion when I rebuild the report
> > Thanks again.
> > Scott Burke
> >
> > "Reeves Smith" wrote:
> > > Scott,
> >
> > > Using the inscope() function with the names of the matrix rows you are able
> > > to tell when the row is a subtotal or not, then place the iif function in the
> > > background color and sometimes the font color.
> >
> > > If you need more help I can find my code example. Last contract have to dig
> > > it up.
> >
> > > Reeves
> >
> > > "Scott Burke" wrote:
> >
> > > > I created a Matrix report with subtotals.
> >
> > > > It would be easier to read if the subtotals were shaded.
> >
> > > > How do I shade the subtotal box. Not the lable box.
> >
> > > > I can see the box labled totals and it is shaded it is the real total box
> > > > that I need to shade.
> >
> > > > Thank you
> > > > Scott Burke
>
> Also, you could try an expression similar to this in the background
> color property:
> =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> Where FieldName can be from an adjacent cell.
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||Scott,
I'm not laughing as I did not even know that existed, thanks for the find.
Reeves
"Scott Burke" wrote:
> OK. I found the answear. Please try NOT to laught too loud. It will hurt
> my feelings.
> On the totals box there is an arrow in the upper right corner. If you click
> on the arrow you will get the properties of the total box itself. Click
> anywhere else in the box adn you get the properties of the subtotal label box.
> Have fun over the weekend.
> Scott Burke
> "EMartinez" wrote:
> > On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> > wrote:
> > > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > > now the report I was working on is gone........
> > >
> > > I will try your suggestion when I rebuild the report
> > > Thanks again.
> > > Scott Burke
> > >
> > > "Reeves Smith" wrote:
> > > > Scott,
> > >
> > > > Using the inscope() function with the names of the matrix rows you are able
> > > > to tell when the row is a subtotal or not, then place the iif function in the
> > > > background color and sometimes the font color.
> > >
> > > > If you need more help I can find my code example. Last contract have to dig
> > > > it up.
> > >
> > > > Reeves
> > >
> > > > "Scott Burke" wrote:
> > >
> > > > > I created a Matrix report with subtotals.
> > >
> > > > > It would be easier to read if the subtotals were shaded.
> > >
> > > > > How do I shade the subtotal box. Not the lable box.
> > >
> > > > > I can see the box labled totals and it is shaded it is the real total box
> > > > > that I need to shade.
> > >
> > > > > Thank you
> > > > > Scott Burke
> >
> >
> > Also, you could try an expression similar to this in the background
> > color property:
> > =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> > Where FieldName can be from an adjacent cell.
> > Hope this helps.
> >
> > Regards,
> >
> > Enrique Martinez
> > Sr. Software Consultant
> >
> >|||On Jun 1, 1:59 pm, Scott Burke <ScottBu...@.discussions.microsoft.com>
wrote:
> OK. I found the answear. Please try NOT to laught too loud. It will hurt
> my feelings.
> On the totals box there is an arrow in the upper right corner. If you click
> on the arrow you will get the properties of the total box itself. Click
> anywhere else in the box adn you get the properties of the subtotal label box.
> Have fun over the weekend.
> Scott Burke
> "EMartinez" wrote:
> > On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> > wrote:
> > > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > > now the report I was working on is gone........
> > > I will try your suggestion when I rebuild the report
> > > Thanks again.
> > > Scott Burke
> > > "Reeves Smith" wrote:
> > > > Scott,
> > > > Using the inscope() function with the names of the matrix rows you are able
> > > > to tell when the row is a subtotal or not, then place the iif function in the
> > > > background color and sometimes the font color.
> > > > If you need more help I can find my code example. Last contract have to dig
> > > > it up.
> > > > Reeves
> > > > "Scott Burke" wrote:
> > > > > I created a Matrix report with subtotals.
> > > > > It would be easier to read if the subtotals were shaded.
> > > > > How do I shade the subtotal box. Not the lable box.
> > > > > I can see the box labled totals and it is shaded it is the real total box
> > > > > that I need to shade.
> > > > > Thank you
> > > > > Scott Burke
> > Also, you could try an expression similar to this in the background
> > color property:
> > =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> > Where FieldName can be from an adjacent cell.
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
Glad you solved the problem. Let me know if I can be of greater
assistance.
Regards,
Enrique Martinez
Sr. Software Consultant
Subscribe to:
Posts (Atom)