Retour a la ligne pl/sql
fidjy5
Messages postés
10
Date d'inscription
Statut
Membre
Dernière intervention
-
fidjy5 Messages postés 10 Date d'inscription Statut Membre Dernière intervention -
fidjy5 Messages postés 10 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
je travaille sur un script ou je dois insérer une base si elle n'existe pas ainsi que d'autres éléments et je n'arrive pas à ajouter un trigger sur cette table..
voici l'entete du code:
trigg="IF OBJECT_ID('stat_temp_"&schema&"') IS NOT NULL EXECUTE 'CREATE TRIGGER [verif_"&schema&"] ON [dbo].[stat_temp_"&schema&"] "
trigg=trigg&"AFTER INSERT AS "&vbCrLf&" DECLARE @cpt int;"&vbCrLf&" DECLARE @good int;"&vbCrLf&" DECLARE @tiers int;"&vbCrLf
trigg=trigg&"SELECT @good=count(*) from stat_goods where code_good=(select code_good from inserted)"
trigg=trigg&" IF @good=0"
trigg=trigg&" begin"
......
et donc à chaque fois je concatene sauf que cela poseproblèmet que sous sql server 2003 je ne trouve pas le symbole de retour chariot//saut de ligne..
je travaille sur un script ou je dois insérer une base si elle n'existe pas ainsi que d'autres éléments et je n'arrive pas à ajouter un trigger sur cette table..
voici l'entete du code:
trigg="IF OBJECT_ID('stat_temp_"&schema&"') IS NOT NULL EXECUTE 'CREATE TRIGGER [verif_"&schema&"] ON [dbo].[stat_temp_"&schema&"] "
trigg=trigg&"AFTER INSERT AS "&vbCrLf&" DECLARE @cpt int;"&vbCrLf&" DECLARE @good int;"&vbCrLf&" DECLARE @tiers int;"&vbCrLf
trigg=trigg&"SELECT @good=count(*) from stat_goods where code_good=(select code_good from inserted)"
trigg=trigg&" IF @good=0"
trigg=trigg&" begin"
......
et donc à chaque fois je concatene sauf que cela poseproblèmet que sous sql server 2003 je ne trouve pas le symbole de retour chariot//saut de ligne..
trigg="IF OBJECT_ID('stat_temp_"&schema&"') IS NOT NULL EXECUTE 'CREATE TRIGGER [verif_"&schema&"] ON [dbo].[stat_temp_"&schema&"] "
trigg=trigg&"AFTER INSERT AS CHAR(13) & CHAR(10) DECLARE @cpt int;"&vbCrLf&" DECLARE @good int;"&vbCrLf&" DECLARE @tiers int;"&vbCrLf
trigg=trigg&"SELECT @good=count(*) from stat_goods where code_good=(select code_good from inserted)"
trigg=trigg&" IF @good=0"
pour tester ca ne me fait aucun retour à la ligne