Viewing 15 posts - 4,096 through 4,110 (of 5,590 total)
Oleg Netchaev (6/2/2010)
Something like this should do it:
select convert(varchar(10), getDate(), 120)The above returns 2010-06-02 when ran at any time today.
Hope this helps.
For a faster method, check out the "Common Date...
June 2, 2010 at 2:45 pm
divyanth (6/2/2010)
using a CTE instead of a sub query would improve the performance of the query
Nope, not at all. A CTE is essentially a pre-defined sub-query (unless it's using...
June 2, 2010 at 2:43 pm
I got lucky... I got it right. Partly from discounting some, and the rest by what didn't make sense.
I also agree... excellent explaination of the answer.
June 2, 2010 at 11:47 am
Store the result from the first query into a variable that can be used by the second query.
See this link for more about doing this in an Execute SQL Task.
June 1, 2010 at 7:20 pm
_taz_ (6/1/2010)
yes I need to store it seperate for now.I have never done an update with a calculation. just simple
update table
set columnx=y
where columnz = null
type of stuff
thanks
First, I...
June 1, 2010 at 7:18 pm
Nagesh S-432384 (5/31/2010)
I 100% agree with you Jeff, my solution was for limited number of records not for huge data.Nag
How many times have you been told that some code will...
June 1, 2010 at 7:14 pm
Did you try clicking the "Help" button on the Execute SQL Task Dialog box after going to the Result Set tab?
It goes to something like this.
June 1, 2010 at 7:09 pm
For the most part, CTEs are just a "pre-defined sub-query". The exception is recursive CTEs, where the CTE actually references itself.
So, your query is equal to:
SELECT EMPID, NAME
...
June 1, 2010 at 6:54 pm
The only way that this query is going to return a single integer value is if both queries return the same value... and that's because of the UNION (vs. UNION...
June 1, 2010 at 6:40 pm
Peter Veilleux-436764 (6/1/2010)
PaulB-TheOneAndOnly (6/1/2010)
Let developers play in Dev but only DBA has the power to promote code...
June 1, 2010 at 2:54 pm
I'm not sure about the sql 2000 part (all of our clusters are on SQL 2005), but the rest of it (all Windows Server 2003) looks right.
June 1, 2010 at 1:47 pm
hester84 (5/30/2010)
Wayne, your solution was MUCH better than mine. Cursors are evil 🙂
:blush: Thanks.
Yes, they are. Unless you're in a situation where you actually want things to run...
June 1, 2010 at 1:32 pm
Paul White NZ (5/7/2010)
Garadin (5/6/2010)
To know that much about SQL Server... AND be able to write C# code. Way to make the rest of us look like schmucks ;-).
Hey...
June 1, 2010 at 1:15 pm
Can you use a tinyint in all of the platforms? That would only use 1 byte.
June 1, 2010 at 12:52 pm
Jeff Moden (5/31/2010)
WayneS (5/31/2010)
June 1, 2010 at 11:10 am
Viewing 15 posts - 4,096 through 4,110 (of 5,590 total)