Viewing 15 posts - 8,236 through 8,250 (of 10,144 total)
craighenderson (1/14/2010)
Doh!No I wanted a date 1 year and 8 days ago...
learning all the time, just not quick enough eh 🙂
You're doing just fine, Craig.
January 14, 2010 at 5:50 am
Craig, you can check the values of the variables:
DECLARE @startDate datetime;
DECLARE @enddate datetime;
SET @startDate = dateadd(year, -8, dateadd(day, datediff(day, 0, getdate()), 0));
SET @endDate = dateadd(year, -1, dateadd(day, datediff(day, 0, getdate()),...
January 14, 2010 at 5:30 am
Abhijeet Dighe (1/14/2010)
I want it for storing transaction no.I think it will be better to check in database for uniqueness.
Transaction no.? As in named transactions?
January 14, 2010 at 4:24 am
Abhijeet Dighe (1/14/2010)
Thanks.But if I take only 10 characters of string generated using newid() like this:
select CONVERT(varchar(10), right(newid(),10))
still will it generate unique string?
It depends upon the scope of your requirement....
January 14, 2010 at 3:49 am
Abhijeet Dighe (1/13/2010)
HiSo, newid() function only generates random no.
Will I have to check for its uniqueness?
According to BOL, NEWID() "Creates a unique value of type uniqueidentifier."
January 14, 2010 at 2:40 am
Greg Edwards-268690 (1/13/2010)
Grant Fritchey (1/13/2010)
Steve Jones - Editor (1/13/2010)
Grant,I didn't think it was that bad, but when it doubt, doesn't hurt to apologize.
Yep. I agree. As soon as it was...
January 14, 2010 at 2:05 am
ifila (1/13/2010)
Lynn Pettis (1/13/2010)
January 13, 2010 at 9:31 am
Using 2005, pulling relevant rows from the linked server into a #temp table can dramatically improve performance.
SELECT key, name
INTO #Remote
FROM serverA.dbname.dbo.tablename
UPDATE FROM with a JOIN can be unpredictable if...
January 13, 2010 at 7:36 am
glen.wass (1/13/2010)
i have worked out a method for doing this now,
Step 1 create table with all my results in it, 2 create update table
step 3 create cursor to insert...
January 13, 2010 at 6:28 am
Here are two queries which will do the trick.
Both use a tally table to transform the segments within the column into rows, then use a GROUP BY
to dedupe. To...
January 13, 2010 at 6:18 am
Paul White (1/13/2010)
ifila (1/12/2010)
I did get a couple of suggestions.I bet you did :laugh:
ROFL! <<unprintable>> 😀
Thanks Paul, that made the long slog into work through the snow very worthwhile!
January 13, 2010 at 2:26 am
nialltuohy (1/12/2010)
Thanks, i know it does but i have one small problem, i also need the savings to be split into 4 columns, for example a policy savings column, building_savings,...
January 12, 2010 at 9:54 am
nialltuohy (1/12/2010)
January 12, 2010 at 9:03 am
Something like this?
/** Getting Total Savings per Policy*/
Select 'Policy' AS Sector,
subpolicy_name,
'' AS building_name,
'' AS floor_name,
'' AS room_name,
SUM(CO2_savings) As total_savings
From #CO2temp
group by subpolicy_name
UNION ALL
/** Getting Total Savings per...
January 12, 2010 at 8:07 am
José.Cruz (1/12/2010)
The problem is that the description field is diferente, for instance for machine topdubctx02 you get 2 rows in the result:
TestDate description machname
---------------------------------------------------------------------------------------------
2010-01-07 18:07:45.000 AV Status: Up-to-date 07/01/2010 18:04:29...
January 12, 2010 at 7:09 am
Viewing 15 posts - 8,236 through 8,250 (of 10,144 total)