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
 General SQL Server Forums
 New to SQL Server Programming
 Assignment question, hit road block.

Author  Topic 

slapper
Starting Member

6 Posts

Posted - 2008-03-14 : 03:11:27
I am new to sql.
Question1: How do i run a CHECK against serveral words.
e.g. check("name" is either bill or timmy or sally or jessy)

Question2: What is the best variable to use for time.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-03-14 : 03:14:37

Question 1 : use OR
Question 2 : You can use any variable name you want. It does not matter. .
Maybe the question should be phrase as "What is the best data type to use for time ?". Check the Books Online on all the available data type.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

EugeneLim11
Posting Yak Master

167 Posts

Posted - 2008-03-14 : 09:05:15
Q1: e.g. select name from Employee where name is bill or timmy or sally or jessy
Q2: DATETIME, :P
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2008-03-14 : 09:10:51
Q1
WHERE name IN ('Bill','timmy','sally','jessy')

Q2
you can't store time by itself in SQL 2005, you should use datetime datatype

Jim

Jim F
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-14 : 09:12:26
Again, what is your definition of time for this question?

Is it "time taken", ie number of seconds, for a specific task?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -