Glad I could help, try it out and see if you can adapt it to your situation, I'd try and finish but another problem just got dumped on me ( this one from my boss, I guess it takes priority ;-) ).
Gotta go for now.
John
OK, I got some code from page 384 of "Microsoft SQL Server 2000 Bible" by Paul Nielsen and did some testing:
-- Note: This can be cut and pasted into Query Analyzer without modification and run as is.
Use tempdb
Go
Set NoCount On
-- Set up the testing table
If Exists( Select 1...
I'm not sure of the coding off the top of my head but a recursive select is generally the way to pivot row data into column data when the number of records is unknown.
I'll see if I can find some example code.
John
ESquared, that is a very good point.
OK then, if decimal/numeric data types of different precisions are considered different data types, why couldn't the SQL Server team include the precision of each type in the error message?
ie:
Error converting data type decimal (20, 5) to decimal (20, 3)...
Glad I could help, I've run into this sort of issue before and I find that it's always best to explicitly define the value before assigning it to the variable.
Sometimes SQL Server acts so dumb...
John
First of all, I agree with all of the above in that 84 seems to be incredibly excessive and most likely should be split among several cubes.
Secondly, I don't believe that the build time you stated is unreasonable, unless you have half a dozen other cubes with similar times that need to be...
Just for curiosity's sake, try:
SET @CullSlabs = CAST(CAST(ISNULL(@CullSlabs, 0) as decimal(16,3)) / 2000.0 AS decimal(16,3))
And see what happens.
John
SQL Server 2000 only has the datetime and smalldatetime types for storing date information. However, if you only supply the date portion and not the time, then SQL Server will automatically append the time of midnight (00:00:00.000) to the date when storing. This can work perfectly well in...
SQLHunter,
Sorry, been away for a while.
I am not sure what you mean here, can you explain further?
Since you seem to be interested in all three paths succeeding together or not at all, I'll try to explain my original post a little more clearly.
To have multiple "paths" in a single...
It is actually possible to have 3 separate workflows in a single transaction, but there are a few caveates(sp?).
First, all of the tasks must use the same connection. This also means that as only a single task may execute at a time, SQL Server may do a lot of switching between workflows during...
Try wrapping your case statements inside of coalesce functions with the alternate path of '' or ' '.
Sample as follows works:
Declare @Col1 int,
@Col2 int,
@Col3 int
Set @Col1 = 0
Set @Col2 = 0
Set @Col3 = 3
Select Col1 = @Col1,
Col2 = @Col2,
Col3 = @Col3...
I'm a bit leary of performing comparisons using Between, <, <=, >, and >= on character data. If what you are trying to accomplish is to select all records where the MYDATE field is (using your example) equal to January 14, 2004 or January 15, 2004 then you might try:
Select *
From TableA...
Try doing the modification in Enterprise Manager instead of Query Analyzer.
I believe that in the background it actually does recreate the table, but the end result is that the columns are in the order you put them in.
HTH,
John
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.