Viewing 15 posts - 3,616 through 3,630 (of 5,504 total)
I would use the "quirky update" (or 3-part-update):
DECLARE @tbl TABLE
(
Region CHAR(10),Col1 CHAR(1), Col2 CHAR(1),Col3 CHAR(1)
)
INSERT INTO @tbl
SELECT 'SOUTH','N','N','Y' UNION ALL
SELECT 'SOUTH','Y','N','N'
DECLARE @n CHAR(1)
SET @n='0'
UPDATE @tbl
SET
@n=col3=CASE WHEN @n='0' AND col3='N'...
April 30, 2010 at 2:29 pm
CirquedeSQLeil (4/30/2010)
Has anybody here ever tried setting their sa account password to contain emoticons? Or any sql logon password for that matter.
sa password =...
April 30, 2010 at 9:53 am
CirquedeSQLeil (4/29/2010)
...You guys have more patience than I. That series would have torqued me off pretty good.
I guess you might get a chance on another thread you're participating...
April 30, 2010 at 9:42 am
Lynn Pettis (4/29/2010)
By the way, did you see the latest post?
Yes, I've seen it but decided not to answer since I assumed that "bye" actually implied he's leaving 😀
So far...
April 30, 2010 at 9:40 am
Please have a look at the CrossTab article as well as the DynamicCrossTab article referenced in my signature.
This will most definitely help you to solve this issue.
April 30, 2010 at 5:02 am
CirquedeSQLeil (4/29/2010)
It has lost its tutu.
... but it can sing now!
April 29, 2010 at 5:06 pm
Lynn:
See, the hippo is doing just fine!
April 29, 2010 at 4:32 pm
@Lynn: May I take a break at the TITD? I'd even walk the hippo, if needed...
I need to take a break and relax before I cannot resit anymore to post...
April 29, 2010 at 4:04 pm
Digs (4/29/2010)
...Please fix your code errors. ...
Pardon me??
In your initial post you defined a table [dbo].[DIM_OHLC_Xml] without the columns you want to insert into based on the query you...
April 29, 2010 at 3:44 pm
Like I said before, I'm not considering myself as a guru, but here's how I would do it:
CREATE TABLE #tbl
(
RowINT,
IDINT,
DatecreatedDATETIME,
EventINT,
Value INT
)
INSERT INTO #tbl
SELECT 1,1,'2010-04-01 06:16:16.623',0, NULL UNION ALL
SELECT 2,1,'2010-04-01 12:25:18.940',0,...
April 29, 2010 at 3:32 pm
I'm by far no SQL Server Guru, but that issue seems to be solvable.
The question is: What have YOU tried so far?
Also, if you want some of the heavy hitters...
April 29, 2010 at 12:19 pm
What would the formula look like? Not having sample values, but a more general description.
Like (SUM(all values)+(values with < condition >) * < other values with different condition >)/MAX(value)*100
April 29, 2010 at 9:45 am
Still not sure what the problem is... your example works just fine:
DECLARE @tbl TABLE
(
DATE DATETIME,
amount DECIMAL(10,2),
interest FLOAT
)
INSERT INTO @tbl
SELECT '2009-04-10 00:00:00.000', 450.00, 00.23 UNION ALL
SELECT '2009-04-10 00:00:00.000', 451.00, -1.20 UNION...
April 29, 2010 at 9:22 am
tommill (4/29/2010)
Thanks for this. It works! Thanks very much.Tom
Glad I could help! 😀
But do you know HOW it works, not only THAT it works?
It's important to understand the code, not...
April 29, 2010 at 9:19 am
It's actually not a rounding issue. It's a form of presenting the result. This should be done at the frontend side, not within SQL Server.
April 29, 2010 at 5:48 am
Viewing 15 posts - 3,616 through 3,630 (of 5,504 total)