Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Manually Insert NULL into field

Author  Topic 

jaroot
Starting Member

46 Posts

Posted - 2006-01-05 : 11:56:13
Is there a keyboard shortcut to insert a <NULL> into a given SQL field?

I th ought I read somewhere it was ALT-F4 but that doesn't seem to work.

Thanks!

jaroot
Starting Member

46 Posts

Posted - 2006-01-05 : 12:05:16
BTW: ALT-F4 actually closes SQL all together.. so don't try it :)
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-01-05 : 12:19:00
What is ur client ? Query Analyzer ? ASP ? VB ? Java ?

I don't know about keyboard shortcuts but
If its a query:
if the table has fields (a,b,c,d,e,f,g,h)
Insert into tbl (a,b,e,g) values('aa','bb','ee','gg')
Inserts Null to all fields (if no defaults specified) not in the list - ie. for the fields c,d & h

if u want to purposely put Null into a field u can use
Insert into tbl (a,b,c,d) values('aa','bb',Null,Null)
Inserts Null to all fields c & d and for the fields e,f,g & h as well
Go to Top of Page

jaroot
Starting Member

46 Posts

Posted - 2006-01-05 : 15:59:58
SQL 2K..

My issue is that I'm testing on an already existing date field, and I need to "reset" the record
if you will by NULL'ing out the date field.
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-01-05 : 16:29:41
U have a table and u want to change some field content to Null ?

Update urTable set urDateOrAnyField = Null where urCondition
Run the proper statement on the query analyzer.
If u tell us what ur table & field names and what u want to do as well, v can give the exact solution.
Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-01-05 : 23:39:03
Are you trying entering it thru Enterprise Manager?
then try ctrl + 0 (zero)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-06 : 00:45:00
Dont try to update the column thru EM, use query analyser with Update query

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Yossi Bressler
Starting Member

2 Posts

Posted - 2010-08-30 : 05:22:14
Use Ctrl + 0
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-08-31 : 05:46:34
quote:
Originally posted by Yossi Bressler

Use Ctrl + 0


Ok. Read my previous answer

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Yossi Bressler
Starting Member

2 Posts

Posted - 2010-08-31 : 13:25:11
Madhivanan,
Some how I miss it. Sorry.
Why to avoid update the column thru EM?
Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-09-01 : 05:16:19
quote:
Originally posted by Yossi Bressler

Madhivanan,
Some how I miss it. Sorry.
Why to avoid update the column thru EM?
Thanks


That is not a good practice. For large number of data, it will be very slow. Also it would throw error if you update an unique column value with a value which is already available

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-09-01 : 06:17:35
This is a 4 year old topic!!

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

joeller
Starting Member

15 Posts

Posted - 2014-06-27 : 11:52:06
Thank you shallu1_gupta and Yossi Bressler. I've been looking everywhere for that.

@madhivanan, sometimes you just want to reset one value back to what is was at the beginning of the test. It is a major pain in the you know what to have to write a query each time.

E.R. Joell MCDBA
Go to Top of Page
   

- Advertisement -