Viewing 15 posts - 421 through 435 (of 516 total)
Kingston Dhasian (7/27/2012)
But, if the...
July 27, 2012 at 12:41 pm
Step 1 : adds one day to current datetime
SELECT GETDATE()+1 AS NextDay
Step 2 : If only date is required
SELECT CONVERT(DATE,GETDATE()+1) AS NextDay
July 27, 2012 at 12:37 pm
Lynn Pettis (7/27/2012)
Lokesh Vij (7/27/2012)
SELECT name column_name,
CASE is_ansi_padded
...
July 27, 2012 at 12:24 pm
To further add (SQL Server 2012 BOL):
In a future version of Microsoft SQL Server ANSI_PADDING will always be ON and any applications that explicitly set the option to OFF will...
July 27, 2012 at 12:20 pm
For checking ANSI_PADDING on columns:
SELECT name column_name,
CASE is_ansi_padded
...
July 27, 2012 at 12:16 pm
Temp Objects are always tied to the current session. As soon as the session is closed, all the temp objects created for that session are destroyed from Temp DB
July 27, 2012 at 12:08 pm
corbincreativecomputing (7/26/2012)
July 26, 2012 at 7:48 am
+1
Kartik, even my query gives the same output as that of Chris 🙂
July 26, 2012 at 7:27 am
ChrisM@Work (7/26/2012)
neil-560592 (7/26/2012)
...Why is it missing the first two values (USD and EUR)?
Thanks
Well I'm stumped on this one. The CASE expression is a red herring - it's irrelevant. What's significant...
July 26, 2012 at 7:18 am
Miles Neale (7/25/2012)
1. The update is a delete and add, both could generate a message in a...
July 26, 2012 at 6:09 am
Kindly post some sample data and expected result. I will get back to you
July 26, 2012 at 6:01 am
deepzzzz (7/26/2012)
Please find the below query
INSERT INTO tbl_employee (EmpNo,CompanyID,MngrID,DateOfFiled,DateOfClosed,DateOfCreation
,LastModified,Active,flag)
VALUES(
'2011-1508' ,89827,null,null,null,GETDATE(),GETDATE(),1,'C')
In the table, column 'Active' is of type int
I...
July 26, 2012 at 4:48 am
Like this:
Select col1.column_name,col2.column_name
FROM
(SELECT row_number() over (order by c.name) rnum,
c.name AS column_name
FROM AADHAR_KYR.sys.tables AS t
INNER JOIN AADHAR_KYR.sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
where t.name='EID_UID_MAPPING' ) as [Col1],
(SELECT row_number()...
July 26, 2012 at 4:38 am
Are you looking for something like this:
CREATE TABLE [productsalesRanked](
[rank1] [bigint] NULL,
[unitssum] [float] NULL,
[nvarchar](5) NULL,
[ProductSalesPopularityID] [int] NOT NULL,
[categoryid] [int] NOT NULL,
[ProductID] [int] NOT NULL,
[UnitsSold] [int] NULL
);
INSERT INTO productsalesranked VALUES
(1,13.5509396636993,'A',58,270789,1431415,274),
(2,13.1058358061325,'B',58,270789,2975838,265),
(3,13.0069238377844,'A',58,270789,1431410,263),
(4,12.6112759643917,'A',58,270789,1445296,255),
(5,12.6112759643917,'A',58,270789,2960786,255),
(6,7.81404549950544,'C',58,270789,2975847,158),
(7,5.98417408506429,'C',58,270789,1431417,121),
(8,4.50049455984174,'D',58,270789,1708294,91),
(9,3.41246290801187,'B',58,270789,1431416,69),
(10,2.67062314540059,'A',58,270789,2975840,54),
(11,1.68150346191889,'D',58,270789,1445294,34),
(12,1.53313550939664,NULL,58,270789,2207608,31),
(13,1.38476755687438,'B',58,270789,1431418,28),
(14,1.13748763600396,'B',58,270789,1445292,23),
(15,0.939663699307616,'C',58,270789,1445297,19),
(16,0.890207715133531,NULL,58,270789,2975839,18),
(17,0.791295746785361,NULL,58,270789,2975844,16),
(18,0.494559841740851,'D',58,270789,2207610,10),
(19,0.494559841740851,'D',58,270789,1445295,10),
(20,0.395647873392681,NULL,58,270789,3077856,8),
(21,0.346191889218595,'C',58,270789,1708290,7),
(22,0.29673590504451,NULL,58,270789,1445298,6),
(23,0.0989119683481701,'D',58,270789,2975842,2),
(24,0.0989119683481701,NULL,58,270789,2975846,2),
(25,0.0494559841740851,NULL,58,270789,1431414,1),
(26,0.0494559841740851,NULL,58,270789,2207609,1),
(27,0.0494559841740851,'D',58,270789,1706287,1),
(28,0.0494559841740851,NULL,58,270789,2975841,1),
(29,-0.0494559841740851,'D',58,270789,2975843,-1),
(1,17.6112412177986,'C',58,270795,1445199,376),
(2,16.5339578454333,'A',58,270795,1445197,353),
(3,7.40046838407494,'B',58,270795,1708203,158);
SELECT p.ProductSalesPopularityID,
p.categoryid,
p.ProductID,
UnitsSold,
rank1,
CAST(unitssum...
July 26, 2012 at 4:29 am
anthony.green (7/26/2012)
Damn, got 3 out of the 4, I thought mirroring wouldn't of been true as it is now a depreciated feature so, wouldn't of thought the two would co-exist.
I...
July 26, 2012 at 3:50 am
Viewing 15 posts - 421 through 435 (of 516 total)