I am trying to insert data into a SQL Server 2000 database with the help of ADO in Delphi 2007.
So far I've written something like this:
insert into (a,b)
select :a,:b
qry.parameters.parambyname('a').value := '';
qry.parameters.parambyname('b').value := '';
The error I get is:
Disallowed implicit conversion from data type text to data type nvarchar...
use the convert function to run this query.
The columns in the table allow NULL values.
What I want is that the SQL Server table shows NULL where the value is ''. How can I achieve that?
you can replace with theses lines
qry.parameters.parambyname('a').value := Null;
qry.parameters.parambyname('b').value := Null;
qry.parameters.parambyname('a').value := unassigned;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With