Viewing 15 posts - 4,096 through 4,110 (of 5,588 total)
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.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
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...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 1, 2010 at 1:15 pm
Can you use a tinyint in all of the platforms? That would only use 1 byte.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 1, 2010 at 12:52 pm
Jeff Moden (5/31/2010)
WayneS (5/31/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 1, 2010 at 11:10 am
Jeff Moden (5/31/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 1, 2010 at 11:06 am
This post is just to include an alternate method. I haven't tested the various methods, but I believe that the "Quirky Update" solution that Jeff presented will probably be the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 31, 2010 at 7:13 pm
Viewing 15 posts - 4,096 through 4,110 (of 5,588 total)