Viewing 15 posts - 1,576 through 1,590 (of 2,458 total)
Was stuck trying to do without cte/subquery... Using my sample data above:
SELECT
Col1 = ISNULL(a.name,b.name),
Col2 = CASE ISNULL(a.name,'') WHEN '' THEN 'Table B' ELSE 'Table A' END
FROM @tableA...
April 20, 2015 at 10:42 am
I was thinking....
DECLARE @tableA TABLE (id int, name varchar(20));
DECLARE @tableB TABLE (number int, name varchar(20));
INSERT @tableA VALUES
(101,'Dante'),
(102,'Henry'),
(103,'Harold'),
(104,'Arnold');
INSERT @tableB VALUES
(102,'Dante'),
(107,'Gilbert'),
(109,'Harold'),
(110,'Arnold'),
(106,'Susan'),
(112,'Marian');
WITH names AS
(
SELECT a = a.name, b = b.name
FROM @tableA...
April 20, 2015 at 10:17 am
Great article Sam. Simple, to the point, easy read - well done sir!
April 20, 2015 at 9:35 am
I could be wrong but I don't think so. To my knowledge the wizard is only available when you select "New Report".
April 18, 2015 at 1:08 pm
I was a DBA turned developer in 2010. I like administration but love development. If you are interested in a career as a SQL Developer you should consider getting up...
April 18, 2015 at 1:00 pm
sandy.alvarez (4/17/2015)
BMC_CORE_BMC_BaseElement.Name, BMC_CORE_BMC_BaseElement.instanceid,BMC_CORE_BMC_BaseElement.reconciliationidentity
FROM ARSystem.dbo.BMC_CORE_BMC_BaseElement BMC_CORE_BMC_BaseElement (NOLOCK)
WHERE BMC_CORE_BMC_BaseElement.DatasetId='BMC.ASSET' AND
BMC_CORE_BMC_BaseElement.createdate>='2014-01-01' AND
BMC_CORE_BMC_BaseElement.createdate<='2014-12-31' AND (
BMC_CORE_BMC_BaseElement.submitter='syl'OR
BMC_CORE_BMC_BaseElement.submitter='salv'OR
BMC_CORE_BMC_BaseElement.submitter='aj') order by 1
You're missing a SELECT statement. Using NOLOCK removes the guarantee that...
April 17, 2015 at 7:07 pm
dmodersk (4/17/2015)
First, a temp result set is created with all the rows...
April 17, 2015 at 2:04 pm
I have not worked with SQL Server HA technologies (clustering, mirroring, replication, Log Shipping) since I was a DBA but I'll give you a few questions and the thinking behind...
April 17, 2015 at 1:37 pm
Ok, I put together some DDL and sample data... I screwed up the aliases a little compared to what you have but this should still suffice. What you are doing...
April 17, 2015 at 1:02 pm
DDL and sample data?
April 17, 2015 at 12:33 pm
Excellent, glad that worked for you.
April 17, 2015 at 12:30 pm
With respect to records that are duplicated, let's say you only wanted the one with the most recent
To get the records with the oldest Export date you could do...
April 17, 2015 at 12:16 pm
I'm assuming you want your query results to include the Export date? and if so which record to you want keep (e.g. the one with the earliest Export date? oldest?)
April 17, 2015 at 12:01 pm
Nope, not that I am aware of. Not without using a sp_cmdshell or other non-tsql scripting tool
What's wrong with this?
SELECT
DbName = db.name,
FileType = CASE...
April 17, 2015 at 11:54 am
Katerine459 (4/16/2015)
April 16, 2015 at 9:16 pm
Viewing 15 posts - 1,576 through 1,590 (of 2,458 total)