Viewing 15 posts - 346 through 360 (of 627 total)
Luis Cazares (4/11/2016)
yb751 (4/11/2016)
Pretty cool technique I learnt from Luis. 😉
You just made my day 🙂
I learned this concatenation method from Wayne Sheffield, which he explains it in here: http://www.sqlservercentral.com/articles/comma+separated+list/71700/
And...
April 11, 2016 at 9:21 am
Hey this is an example using a dynamic solution.
create table #TEST
(
YearMonth varchar(10),
PatientStatus varchar(10),
Location varchar(10),
PatientVisits int
)
DECLARE @sql VARCHAR(MAX)
insert into #TEST(YearMonth, PatientStatus, Location, PatientVisits) values('2015-10','IN','B4','103')
insert into #TEST(YearMonth, PatientStatus, Location, PatientVisits)...
April 11, 2016 at 8:09 am
This can also be achieved using crosstabs which have the benefit of being simpler and faster. You'll still need to come up with a dynamic solution though.
SELECT
PatientStatus,
Location,
MAX(CASE WHEN YearMonth...
April 11, 2016 at 7:11 am
Steve Jones - SSC Editor (4/7/2016)
April 8, 2016 at 7:25 am
Seems to me like you got tripped up because you copy and pasted the code from online documentation. For future reference keep in mind why the square brackets are...
April 7, 2016 at 9:27 am
Phil Parkin (3/31/2016)
Sergiy (3/30/2016)
1. Create a "translation" table:
CREATE TABLE #Mapping (
FromChar NCHAR(1) PRIMARY KEY,
ToChar NCHAR(1)
)
INSERT INTO #Mapping ( FromChar, ToChar )
SELECT 1, 'A'
UNION ALL
SELECT 2, 'B'
UNION...
March 31, 2016 at 8:25 am
Damn it guys! Do you realize how hungry you're all making me right now?!? LOL
March 31, 2016 at 7:51 am
I don't recommend using 'comma' joins as this is not the standard and easier to make a mistake. Learn and use JOIN...trust me you'll be better off for it.
March 29, 2016 at 8:18 am
GilaMonster (3/29/2016)
yb751 (3/29/2016)
I could have sworn I remember reading that declaring larger column sizes than required could cause some inefficiencies. i.e. incorrect estimates, over allocating memory...
I wouldn't be surprised...
March 29, 2016 at 7:51 am
I could have sworn I remember reading that declaring larger column sizes than required could cause some inefficiencies. i.e. incorrect estimates, over allocating memory...
I wish I could find good...
March 29, 2016 at 7:26 am
Lynn Pettis (3/28/2016)
Personally, every backup to its own file whether full, differential, or transaction log. Also, personal preference is to disk, then if needed backup the file(s) to tape.
Exactly...
March 28, 2016 at 1:56 pm
Jacob Wilkins (3/22/2016)
Steve Jones - SSC Editor (3/22/2016)
Alan.B (3/21/2016)
March 22, 2016 at 8:57 am
SQLRNNR (3/21/2016)
Brandie Tarvin (3/21/2016)
Lynn Pettis (3/21/2016)
March 21, 2016 at 9:04 am
I've always been truthful and tend to be modest during interviews. I have often wondered if I have lost some opportunities to the liars/exaggerators because the interviewer had never...
March 21, 2016 at 8:39 am
Brandie Tarvin (3/21/2016)
For those of you with standing desks, ArsTechnica says it may not be helping[/url] you at all.
...and 'they' said margarine was better for you. Oh wait, it's...
March 21, 2016 at 7:59 am
Viewing 15 posts - 346 through 360 (of 627 total)