SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Manually Insert NULL into field
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jaroot
Starting Member

46 Posts

Posted - 01/05/2006 :  11:56:13  Show Profile  Send jaroot an AOL message  Reply with Quote
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 - 01/05/2006 :  12:05:16  Show Profile  Send jaroot an AOL message  Reply with Quote
BTW: ALT-F4 actually closes SQL all together.. so don't try it :)
Go to Top of Page

Srinika
Flowing Fount of Yak Knowledge

Sri Lanka
1378 Posts

Posted - 01/05/2006 :  12:19:00  Show Profile  Reply with Quote
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 - 01/05/2006 :  15:59:58  Show Profile  Send jaroot an AOL message  Reply with Quote
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
Flowing Fount of Yak Knowledge

Sri Lanka
1378 Posts

Posted - 01/05/2006 :  16:29:41  Show Profile  Reply with Quote
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

India
394 Posts

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

madhivanan
Premature Yak Congratulator

India
22761 Posts

Posted - 01/06/2006 :  00:45:00  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
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 - 08/30/2010 :  05:22:14  Show Profile  Reply with Quote
Use Ctrl + 0
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22761 Posts

Posted - 08/31/2010 :  05:46:34  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
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 - 08/31/2010 :  13:25:11  Show Profile  Reply with Quote
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

India
22761 Posts

Posted - 09/01/2010 :  05:16:19  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
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

Norway
3271 Posts

Posted - 09/01/2010 :  06:17:35  Show Profile  Reply with Quote
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

USA
15 Posts

Posted - 06/27/2014 :  11:52:06  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000