PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.db.ms-sqlserver > Trigger to modify a table
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Trigger to modify a table

Réponse
 
LinkBack Outils de la discussion
Vieux 18/03/2008, 19h57   #1
RogBaker@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Trigger to modify a table

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
  Réponse avec citation
Vieux 19/03/2008, 05h15   #2
Tom van Stiphout
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Trigger to modify a table

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

  Réponse avec citation
Vieux 19/03/2008, 23h41   #3
Erland Sommarskog
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Trigger to modify a table

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
  Réponse avec citation
Vieux 22/03/2008, 03h07   #4
RogBaker@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Trigger to modify a table

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h27.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13706 seconds with 12 queries