Bonjour à tous !
J'essaye de tester l'existence d'une table et de la créer si non.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 if not exists(select name from miswork..sysobjects where name ='MKS_titres' and type='U') begin create table miswork..MKS_titres ( security_id int ) insert into miswork..MKS_titres select distinct IC.security_id from market..indice_component IC where IC.indice_id in (1,2,3,9,10,19,21,22,20,11,12,15) end
mais il me renvoie une erreur qui me laisse entendre que mon test ne fonctionne pas :
Citation:
There is already an object named 'MKS_titres' in the database. (Sur la ligne du create table)
Vous en pensez quoi ? Merci !