+ Post New Thread
Results 1 to 4 of 4
How do you do....it? Thread, SQL Sanity check please in Technical; Code: insert into [SALTO].[dbo].[tb_Users] (name, Title, FirstName, LastName, type, status, id_room, Calendar, CalVersion, CalDate, CalDate2, CalModified, Modified, EditLoaded, EditVersion, office, ...
  1. #1

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,611
    Thank Post
    647
    Thanked 1,617 Times in 1,447 Posts
    Rep Power
    421

    SQL Sanity check please

    Code:
    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

  2. #2


    Join Date
    May 2009
    Posts
    3,018
    Thank Post
    268
    Thanked 800 Times in 605 Posts
    Rep Power
    290
    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.

  3. #3

    Join Date
    Apr 2006
    Posts
    388
    Thank Post
    23
    Thanked 95 Times in 61 Posts
    Rep Power
    45
    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.

  4. #4

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,611
    Thank Post
    647
    Thanked 1,617 Times in 1,447 Posts
    Rep Power
    421
    Ok thanks

    Ben

SHARE:
+ Post New Thread

Similar Threads

  1. POE sanity check - Mode A vs Mode B
    By pete in forum Wireless Networks
    Replies: 5
    Last Post: 7th February 2011, 05:30 PM
  2. New server deployment - sanity check?
    By sparker in forum Hardware
    Replies: 36
    Last Post: 2nd February 2011, 08:05 PM
  3. Sanity Check & Advice re: 3G gateway
    By kmount in forum Internet Related/Filtering/Firewall
    Replies: 6
    Last Post: 13th September 2010, 05:08 PM
  4. Quick Sanity Check....
    By FragglePete in forum Windows Server 2008 R2
    Replies: 3
    Last Post: 21st July 2010, 07:16 PM
  5. VLAN Sanity Check Please
    By ICTNUT in forum Wireless Networks
    Replies: 2
    Last Post: 22nd July 2008, 08:16 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •