Viewing 15 posts - 3,541 through 3,555 (of 8,761 total)
Quick suggestion
😎
USE TEEST;
GO
SET NOCOUNT ON;
IF OBJECT_ID(N'tempdb..#temp') IS NOT NULL DROP TABLE #temp;
CREATE TABLE #temp
(
STORE_ID INT
,PRINTER_NM VARCHAR(50)
,PRIORITY_IND INT
,PRINTER_ID INT
)
INSERT INTO #temp
values(1000,'PRINT1',1,100)
,(1000,'PRINT2',2,101)
,(1001,'PRINT1',1,102)
,(1002,'PRINT2',2,103)
,(1002,'PRINT1',1,104)
,(1002,'PRINT2',2,105)
,(1003,'PRINT1',1,106)
,(1003,'PRINT2',2,107);
SELECT
T.STORE_ID
,MAX(CASE WHEN T.PRIORITY_IND =...
June 1, 2016 at 9:50 pm
Lowell (6/1/2016)
I'm now offering certifications in SQL Fertilization. If you act now i'll offer you 50% off my already low price of $99.
Do you have a BYOD discount? 😛
😎
June 1, 2016 at 3:18 pm
SQL-DBA-01 (6/1/2016)
INSERT mytest
VALUES
(1, CAST('<customer id = ' '1200' '>Acme</customer>' AS XML))
, (2, CAST(...
June 1, 2016 at 1:36 pm
Elementary when using the DelimitedSplit8K function
😎
USE TEEST;
GO
DECLARE @testdata TABLE
(
IDINT NOT NULL,
DegreeStr VARCHAR(100),
YearEarnedStrVARCHAR(100)
);
INSERT INTO @testdata
SELECT 1, 'BS,MS,PhD', '2001,2005,2011' UNION ALL
SELECT 2, 'BS', '2003' UNION ALL
SELECT 3, 'BS,MS', '2002,2008'
SELECT
...
June 1, 2016 at 7:15 am
Ed Wagner (6/1/2016)
June 1, 2016 at 5:30 am
No applicable answer listed as the code is perfectly valid (maybe not valid on SQL Server 2000 but cannot be bothered to check).
😎
June 1, 2016 at 5:24 am
ChrisM@Work (5/31/2016)
May 31, 2016 at 7:50 pm
mark.kremers.prive (5/30/2016)
Eirikur Eiriksson (5/30/2016)
Quick question, what value are you passing with the [-a packetsize] parameter? IIRC, if none is passed it will revert to the default 4096k😎
tried 64k, 32k and...
May 30, 2016 at 10:49 pm
yb751 (5/30/2016)
Eirikur Eiriksson (5/30/2016)
tmmutsetse (5/30/2016)
SELECT
Name,
Memory,
Model
FROM [xxxx].[dbo].[Status]
where
active =...
May 30, 2016 at 9:45 am
tmmutsetse (5/30/2016)
SELECT
Name,
Memory,
Model
FROM [xxxx].[dbo].[Status]
where
active = 1 and
and name...
May 30, 2016 at 9:32 am
tmmutsetse (5/30/2016)
Thanks Tom,Infact i have more than those names mentioned above.Almost 30 names.
Try to write down the definition of the logic, otherwise it will be impossible to construct a query...
May 30, 2016 at 4:52 am
Quick question, what value are you passing with the [-a packetsize] parameter? IIRC, if none is passed it will revert to the default 4096k
😎
May 30, 2016 at 4:29 am
Pre-grouping works quite well in this case, especially if there is a filtered index on the the table for customerID where sales is not null.
😎
;WITH CUSTOMERS_SALE AS
(
...
May 28, 2016 at 10:28 am
TheSQLGuru (5/28/2016)
Eirikur Eiriksson (5/28/2016)
santiagoc93 (5/27/2016)
select customerId, window, product, sales,( Case when count(sales) over(partition by customerid order by customerid) >0 then 1 else 0 end)as class
from #example
Very nice!
😎
The...
May 28, 2016 at 9:39 am
santiagoc93 (5/27/2016)
select customerId, window, product, sales,( Case when count(sales) over(partition by customerid order by customerid) >0 then 1 else 0 end)as class
from #example
Very nice!
😎
The addition of the...
May 28, 2016 at 3:23 am
Viewing 15 posts - 3,541 through 3,555 (of 8,761 total)