|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have a 3rd party program that creates some tables in my sql server
2005 database, then it does inserts on the tables. Is there a way I could create a system level trigger that would immediately and automatically modfiy the table structure after the table is created (hopefully before the inserts occur)? I need to change a field from numeric(5, 0) to numeric(15, 0). Thanks, Roger |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Tue, 18 Mar 2008 11:57:46 -0700 (PDT), RogBaker@gmail.com wrote:
No. Triggers come only in three flavors: insert, update, delete. Contact the vendor of that program. -Tom. >I have a 3rd party program that creates some tables in my sql server >2005 database, then it does inserts on the tables. Is there a way I >could create a system level trigger that would immediately and >automatically modfiy the table structure after the table is created >(hopefully before the inserts occur)? I need to change a field from >numeric(5, 0) to numeric(15, 0). >Thanks, >Roger |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Tue, 18 Mar 2008 11:57:46 -0700 (PDT), RogBaker@gmail.com wrote:
>>I have a 3rd party program that creates some tables in my sql server >>2005 database, then it does inserts on the tables. Is there a way I >>could create a system level trigger that would immediately and >>automatically modfiy the table structure after the table is created >>(hopefully before the inserts occur)? I need to change a field from >>numeric(5, 0) to numeric(15, 0). I'm afraid that Tom was incorrect. You can indeed to this on SQL 2005. Whether it's a good idea with regards to your license agreement etc is another matter. But the change appears harmless to me. Start with looking at the CREATE TRIGGER topic in Books Online and read about DDL triggers. The topic has links to more detailed topics. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Mar 19, 6:41pm, Erland Sommarskog <esq...@sommarskog.se> wrote:
> On Tue, 18 Mar 2008 11:57:46 -0700 (PDT), RogBa...@gmail.com wrote: > >>I have a 3rd party program that creates some tables in my sql server > >>2005 database, then it does inserts on the tables. Is there a way I > >>could create a system level trigger that would immediately and > >>automatically modfiy the table structure after the table is created > >>(hopefully before the inserts occur)? I need to change a field from > >>numeric(5, 0) to numeric(15, 0). > > I'm afraid that Tom was incorrect. You can indeed to this on SQL 2005. > Whether it's a good idea with regards to your license agreement etc is > another matter. But the change appears harmless to me. > > Start with looking at the CREATE TRIGGER topic in Books Online and > read about DDL triggers. The topic has links to more detailed topics. > > -- > Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se > > Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... > Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx Thanks Erland, that does look interesting. I have been experimenting with the DDL trigger and I may get that to do something for me. -Roger |
|
![]() |
| Outils de la discussion | |
|
|