Viewing 15 posts - 361 through 375 (of 394 total)
How about this:
CREATE TABLE ORDERID
(
OrderId Int,
Cost Numeric(9,2),
Indicator int,
[Count] Int
);
INSERT INTO ORDERID VALUES ( 1, 10000, 0, 2 );
INSERT INTO ORDERID VALUES ( 1, 15000, 1, 3 );
SELECT
ZERO.OrderId, ZERO.Cost, ZERO.[Count],
ONE_COST =...
July 31, 2012 at 9:50 am
That didn't work for me - I got repeating rows:
WonkyID Client ...
July 31, 2012 at 9:35 am
Hi Vijay
I've tried a few options on this one, and the only one that works is to create a temp table with the Numeric values (Excluding any alpha), then select...
July 31, 2012 at 5:29 am
You're more likely to get an answer if you make the data easy to set up.
See this thread, post 6 for a way to do it:
http://www.sqlservercentral.com/Forums/Topic1336553-392-1.aspx
(There's an article...
July 31, 2012 at 2:22 am
They must have been thinking of something when they added it. Don't know what though...
July 30, 2012 at 10:46 am
Within reason, you can put as much comments code as you like.
Personally, I don't like too much old code. I'd keep it if a) I thought it might be...
July 30, 2012 at 10:07 am
How is the alert specified exactly? It is specified for success, rather than failure isn't it?
July 30, 2012 at 10:02 am
No, definitely not.
Only the active code gets passed to the optimiser, so the comments don't go anywhere.
If it's slow it's something else, usually a join or the where clause.
Too much...
July 30, 2012 at 9:54 am
You can script that too:
Right-click on table, then select 'Script as' etc
There are some good tips in this thread - see section 6 especially...
http://www.sqlservercentral.com/Forums/Topic1336553-392-1.aspx
July 30, 2012 at 9:10 am
## temp tables only continue to exist if another session is using them, otherwise they get dropped too.
July 30, 2012 at 9:01 am
It's needed to tell EXEC it's a character string.
See this:
ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/bc806b71-cc55-470a-913e-c5f761d5c4b7.htm
both formats 2 & 3 need it - only format 1 doesn't....
July 30, 2012 at 8:50 am
You need double-quotes (i.e. 2 single quotes) for the strings:
set @stmt_Where = 'WHERE (NOT (NAME LIKE '' '')) and LTRIM(RTRIM (NAME)) like ''Estes Express'' '
July 30, 2012 at 8:35 am
Viewing 15 posts - 361 through 375 (of 394 total)