Jump to content

Recommended Posts

Posted

insert into [sALTO].[dbo].[tb_Users] (name, Title, FirstName, LastName, type, status, id_room, Calendar, CalVersion, CalDate, CalDate2, CalModified, Modified, EditLoaded, EditVersion, office, ada, privacy, EnableUpdate, NewCount, CopyCount, SeqNum, HotelStatus, dtActivation, dtExpiration, Dummy1, Dummy2, Dummy3, KeyAuditorType, UpdatePeriod, UpdatePeriodType, WithExpiration, UseAntiPassback, StructureModified, AuditOpenings, KeyWithExpiration, WithPIN, PINCode, id_department, Privilege, LockerUserCode, OldExtID, WiegandCode, id_limited_group, OverrideLockdown,Picture)
values ('Mr I Test', 'Mr', 'I', 'Test', '1', '1', 'NULL', '0', '0', '59:59.0', '59:59.0', '0', '0', '0', '7', '0', '0', '0', '0', '1', '0', '0', '1', '00:00.0', '00:00.0', 'Test person', 'NULL', 'NULL', '0', '10', '0', '0', '0', '0', '1', '1', '0', '-1', '1', '0', '0', 'NULL', 'NULL', 'NULL', '0', 'NULL'

 

Will that work do you think?

 

Ben

Posted
You are missing the ")" at the end of the values list and, depending on the context, possibly a semicolon. But without seeing the table definition, no one could say it would work or not.
Posted

Hello.

 

Watch out for those nulls.

 

'NULL' is not the same thing as NULL, which is to say that one is the word 'NULL' and the other is a black hole.

 

For example, I'm going to create a table and insert two lines, where the first one contains 'NULL' and the second contains NULL:

 

create database edugeek

go

use edugeek

go

 

create table test (ID int, name varchar(10))

 

insert into test ( id, name) VALUES (1, 'NULL')

insert into test (id, name) VALUES (2, Null)

 

 

The following selects return different results.

 

SELECT * FROM TEST where name = 'NULL'

SELECT * FROM TEST where name is null

 

Hope that helps.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...