Viewing 15 posts - 3,511 through 3,525 (of 15,381 total)
rajd2106 (12/1/2014)
In this query I am trying to do aggregation from SALES_DETAIL table :
sum(prod_price) by sales_id & INSERTING into SALES_HEADER table as sales_amount.
Selecting...
December 1, 2014 at 1:17 pm
This was also posted on stackoverflow. http://stackoverflow.com/questions/27232562/issue-with-select-statement-in-a-stored-procedure
Here is the real issue. We can't see your screen, we have no idea what your tables are like and we don't really know...
December 1, 2014 at 10:45 am
rajd2106 (12/1/2014)
I have 3 tables: CUSTOMER, SALES_HEADER, SALES_DETAIL and there are no relationships / keys...
December 1, 2014 at 10:42 am
Also this looks painfully like QA in SQL 2000. Can you confirm which version of sql server you are using? The answers are going to be vastly different if you...
December 1, 2014 at 7:34 am
sqlquery29 (11/26/2014)
I tried writing the function
CREATE FUNCTION dbo.Convert_Date (@date_column decimal(7,0))
Returns date as begin
declare @date date
set @date = CONVERT(DATE,CASE WHEN LEFT(@date_column,1) = '1' THEN '20'
ELSE '19' END + RIGHT(@date_column,6),...
November 26, 2014 at 7:49 am
When I run an analysis to determine long-running queries, these are acting as if they are ad-hoc. Is this normal behavior?
What are you using for this analysis and what do...
November 25, 2014 at 2:54 pm
Cheryl McLaughlin-385812 (11/25/2014)
November 25, 2014 at 2:36 pm
JoshDBGuy (11/25/2014)
We have dozens of stored procs with sp_executesql inside the procs. When I run an analysis to determine long-running queries, these are acting as if they are ad-hoc. Is...
November 25, 2014 at 2:10 pm
Great job posting ddl and sample data. Can you take it one step further and post what the desired output would be for this sample data? I think I get...
November 25, 2014 at 2:08 pm
Yeah that thing needs a complete rewrite. Once you have nested case expressions it is good chance you can simplify. When they are nested this deep it is not longer...
November 25, 2014 at 2:07 pm
MERGE has several bugs. I would avoid it. That being said it is hard to figure out exactly what you are trying to do. Could you just an identity column...
November 25, 2014 at 2:00 pm
sqlquery29 (11/25/2014)
sorry for the confusion...let me be more clear..
The data is extracted to sqlserver from DB2 and date columns are in this format 'CYYMMDD' with decimal datatype.
Now...
November 25, 2014 at 8:33 am
Jeff Moden (11/24/2014)
Sean Lange (11/24/2014)
paul s-306273 (11/24/2014)
Reading 'XYZ', I'm surprised that the use of views is discoraged.
You read that document (which btw is more than 6 years old) and you...
November 24, 2014 at 3:59 pm
rki1966 (11/24/2014)
Great, thanks for your help. Yes, the field names are much better than indicated.
Cool. Glad that worked for you and thanks for letting me know.
November 24, 2014 at 9:43 am
Viewing 15 posts - 3,511 through 3,525 (of 15,381 total)