Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vb.net sql problem
Message
 
 
À
19/01/2012 22:06:57
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01533399
Message ID:
01533400
Vues:
45
>Hi all,
> I use vb.net and TableAdapter. I want to check the @field value include empty string then will adjust the value to NULL.
>Anyone know how can i do, eg. if the @lineno is " " then change to NULL ?
>
>
>INSERT INTO item (itemcode, lineno) values (@itemcode,@lineno)
>
>
>
>thank you

Use NULLIF function, e.g.
insert into Item (ItemCode, LineNo) values (@ItemCode, NULLIF(@LineNo, ''))
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform