Viewing 15 posts - 106 through 120 (of 444 total)
Please what you tried so far?
Here is my guess you need combine two tables into one first
with allRatings as (
select * from [dbo].[InputTest1]
union all
select *, null as [FormOrderForInstnRating],null as [SortOrder]
from...
October 8, 2015 at 7:05 am
Ok, do it with string manipulation. You may eliminate inner CAST if building entire string this way. But for redability i just use two CASTs.
if object_id('Tempdb..#Element1') is not null drop...
October 8, 2015 at 1:43 am
You may wish to add root element to keep output well-formed xml document when Element1 table has more rows . And subgroups naming may be rendered with attribute which...
October 7, 2015 at 3:51 am
To optimize a bit further why declare namespace which is never used in the query
;WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/shareddatasetdefinition')
SELECT
D.field1.value('(SharedDataSet/DataSet/Query/CommandText/text())[1]','VARCHAR(50)') AS CommandText
FROM #demo D;
September 28, 2015 at 12:22 pm
Xquery must contain namespace declaration as it is dealing with namespaced xml.
select field1.query('declare namespace x="http://schemas.microsoft.com/sqlserver/reporting/2010/01/shareddatasetdefinition";
/x:SharedDataSet/x:DataSet/x:Query/x:CommandText') from #demo
September 28, 2015 at 7:26 am
May be you should wait till post-august2015-preview SSDT RTM is released.
September 28, 2015 at 3:58 am
RonKyle (9/24/2015)
I have reworded to ask about classes.
So... how do we get to answer the question again with the revised wording?
Just don't answer in a hurry, wait a...
September 25, 2015 at 5:55 am
I combine -- and /* to make it a bit easier but still have to edit code.
WITH CTE(x) AS (
SELECT NULL
)
/* possible comment */
-- /*
SELECT...
September 25, 2015 at 3:35 am
Manic Star (9/22/2015)
kim / data detection group (9/17/2015)
There are LOTS of times when I need to use a simple local function within a stored procedure, but have to create and...
September 25, 2015 at 2:04 am
WayneS (9/24/2015)
... PATINDEX('[A-Z,a-z][0-9]%', activityName ...
CREATE TABLE #Activities(activityName NVARCHAR(100))
?
September 24, 2015 at 7:49 am
If the first word contains digit then sort by first word parts second part considered to be integer. Otherwise sort by hole column
select activityName
from #Activities
cross apply (select
...
September 24, 2015 at 7:19 am
Note 30days.. is not valid column name anyway.
8000 limit doesn't apply to sp_executesql if only you are not quering linked server, OPENQUERY may be.
September 24, 2015 at 4:53 am
Probably it's cycle detection problem
The query below will return all cycles containing 52342-00
with r as (
select parentid , DetailComponent , DetailLevel
, cast( '->' + DetailComponent + '->' ...
September 23, 2015 at 7:54 am
You may unpivote fixed number of columns and select specified col value without dynamic SQL
declare @t table (
id int identity
,ref01 varchar(10)
,ref02 varchar(10)
,ref03 varchar(10)
,ref04 varchar(10)
,ref05 varchar(10)
,ref06 varchar(10)
);
insert @t values ('a-ref01','a-ref02','a-ref03','a-ref04','a-ref05','a-ref06')
...
September 22, 2015 at 5:22 am
Viewing 15 posts - 106 through 120 (of 444 total)