Click here to Skip to main content
15,905,963 members
Home / Discussions / Database
   

Database

 
GeneralSQL Tree Hierarchy Problem Pin
Dirk Kok2-Dec-04 22:24
sussDirk Kok2-Dec-04 22:24 
GeneralRe: SQL Tree Hierarchy Problem Pin
Michael Potter3-Dec-04 4:34
Michael Potter3-Dec-04 4:34 
GeneralRe: SQL Tree Hierarchy Problem Pin
Chris Meech3-Dec-04 6:44
Chris Meech3-Dec-04 6:44 
GeneralStored Proc and SqlDataAdapter Pin
ccosser2-Dec-04 22:03
ccosser2-Dec-04 22:03 
GeneralAttaching a database to MSDE Pin
mattie202-Dec-04 20:31
mattie202-Dec-04 20:31 
GeneralNested Transaction with SQL Server Pin
Wouter van Eck2-Dec-04 5:21
Wouter van Eck2-Dec-04 5:21 
QuestionHow can i avaoid negative values in SQL? Pin
john kuruvila2-Dec-04 5:14
john kuruvila2-Dec-04 5:14 
AnswerRe: How can i avaoid negative values in SQL? Pin
Colin Angus Mackay2-Dec-04 6:42
Colin Angus Mackay2-Dec-04 6:42 
john kuruvila wrote:
What is the SQL querry for not having negative values in the table?

When you create the table you set a constraint like this:
CREATE TABLE cust_sample
    (
    cust_id                int        PRIMARY KEY,
    cust_name            char(50),
    cust_address            char(50),
    cust_credit_limit    money,
    CONSTRAINT chk_id CHECK (cust_id BETWEEN 0 and 10000 )
    )
If the table is already created you can use ALTER TABLE in order to add the constraint (See the SQL Help files for how to use ALTER TABLE)

Does this help?


Do you want to know more?
WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums


GeneralRe: How can i avaoid negative values in SQL? Pin
john kuruvila2-Dec-04 7:30
john kuruvila2-Dec-04 7:30 
Generalnot allowing negative values Pin
sujithapril2-Dec-04 5:10
sujithapril2-Dec-04 5:10 
GeneralRe: not allowing negative values Pin
Colin Angus Mackay2-Dec-04 6:41
Colin Angus Mackay2-Dec-04 6:41 
GeneralRe: not allowing negative values Pin
sujithapril2-Dec-04 7:23
sujithapril2-Dec-04 7:23 
GeneralRe: not allowing negative values Pin
Colin Angus Mackay2-Dec-04 7:26
Colin Angus Mackay2-Dec-04 7:26 
GeneralRe: not allowing negative values Pin
sujithapril2-Dec-04 7:50
sujithapril2-Dec-04 7:50 
GeneralRe: not allowing negative values Pin
Colin Angus Mackay2-Dec-04 7:59
Colin Angus Mackay2-Dec-04 7:59 
GeneralRecordset "LIKE" filter of a number column Pin
Menny Even Danan1-Dec-04 21:51
Menny Even Danan1-Dec-04 21:51 
GeneralRe: Recordset "LIKE" filter of a number column Pin
jlawren72-Dec-04 5:27
jlawren72-Dec-04 5:27 
Generalcan't DELETE records in excel Pin
scoroop1-Dec-04 11:15
scoroop1-Dec-04 11:15 
GeneralRe: can't DELETE records in excel Pin
Christian Graus1-Dec-04 12:27
protectorChristian Graus1-Dec-04 12:27 
GeneralRe: can't DELETE records in excel Pin
scoroop1-Dec-04 12:36
scoroop1-Dec-04 12:36 
GeneralRe: can't DELETE records in excel Pin
jonathan152-Dec-04 23:21
jonathan152-Dec-04 23:21 
GeneralRe: can't DELETE records in excel Pin
scoroop3-Dec-04 2:38
scoroop3-Dec-04 2:38 
GeneralErr -2147467259: Operation must use an updatable query. Pin
Khang Nguyen1-Dec-04 10:23
Khang Nguyen1-Dec-04 10:23 
GeneralRe: Err -2147467259: Operation must use an updatable query. Pin
Edbert P1-Dec-04 10:34
Edbert P1-Dec-04 10:34 
GeneralRe: Err -2147467259: Operation must use an updatable query. Pin
Khang Nguyen2-Dec-04 4:21
Khang Nguyen2-Dec-04 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.