Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is good web site to get T-SQL syntax 1

Status
Not open for further replies.

Rousseau10

Programmer
Feb 22, 2005
242
US
what is good web site to get T-SQL syntax


I forgot my T-SQL book and cannot even delete rows from a table. I am converting from access.
My
DELETE * FROM CUSTOMERS


give me an error on the asterisks .

Althoug I read if I want to delete all rows I should just truncate since it does not lof the transaction and add unneeded cost

But I do not know the truncate systanx either so I need a good site, tanx again

I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
 
Code:
TRUNCATE TABLE CUSTOMERS
DELETE * FROM CUSTOMERS WHERE ....

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
sue per tanx!

I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
 
sorry
Code:
DELETE FROM CUSTOMERS WHERE ....

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
yeah I figured that! you musta been tinkin access. Any how what is syntax if you will for the condition to delete not null cells?


DELETE FROM CUSTOMERS WHERE CUSTOMERID <> NULL
or
DELETE FROM CUSTOMERS WHERE CUSTOMERID IS NOT NULL

I cannot seem to get it!



I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
 
Code:
DELETE FROM CUSTOMERS WHERE CUSTOMERID IS NOT NULL

is correct

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
TANX!

I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
 
Rousseau10,

Just a reminder, these are pretty basic questions you are asking. I posted a response, on one of your other many threads, the directions to find the BOL (SQL Server's Books OnLine). You really should start using that.

We are glad to help you here, but you really should be looking up these basic questions.

-SQLBill

Posting advice: FAQ481-4875
 
Sorry, I could not find this scrolling through QA F1 Books Online.
It is why I was asking for a good website in this post but I got a syntax answer so i rolled with it! I agree it is too basic for the forum.
I forgot my T-SQL book at home today!!

I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
 
Rousseau10,

when using BOL use the index tab to do searches of BOL - like your example above if you had put delete in the search box it would have directed you to all sorts of items about delete - delete described, from clause etc.

Also the truncate syntax - type truncate in the search and there it is :)

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
I did but icame up with a full blown syntax example and with every option known to man and I could decifer the basic delete all rows method.

I ge the message though. Do not worry I will have more challenging questions soon. I have 3 more weeks to become an expert in SQL. Which is of corse impossible, but "shoot for the stars, you might get half way".



I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
 
BOl does give the whole syntax at the top of the pager but if you scroll down there are usually good understandable examples of actual use.

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
I guess I was just too impatient!!, thanx

Its a doozy try to prepare for something while having to maintain at you current job. I am suppossed to be overhauling 1 program, fixing another, taking on 6 more programs to troubleshoot for operators, and 30 more program to rewrite by the end of may.Hello, u may want to hire another programmer. All these are data extraction programs using Access and VBA. Luckily, I am able to work on sql server while I am running programs that I am trouble shooting..........what fun. I cannot wait till I have just 1 job to foucus on!!!!!!! Come on June!!!!!

I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top