Viewing 15 posts - 271 through 285 (of 444 total)
Start with MSDN XML chapter http://msdn.microsoft.com/en-us/library/bb522446.aspx. Specifically, you need xml namespace processing http://msdn.microsoft.com/en-us/library/ms177400.aspx
For example
declare @x XML =
'<?xml version="1.0" encoding="UTF-8"?>
<rts:RateMessage xmlns:rts="http://www.reuters.com/Rate" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.reuters.com/Rate.xsd ">
<FXRates Timestamp="20141203164900" Type="Cash">
<Rate Name="USD.SAR" Type ="FXRate" Buy="3.75"...
December 22, 2014 at 2:29 am
If there're no other Genders besides 'Man' and 'Women' then you need only 3 queries under current setup.
I second a hope that Distance is a numeric column. Then just
...WHERE...
December 19, 2014 at 5:19 am
This script uses data available at hand to show the idea.
select res = case det.rn
when 0 then '[titles],'
+ t1.title_id +','
+ t1.title +','
...
December 19, 2014 at 4:58 am
--update dbo.MyDB_RowCnt
begin tran tt;
delete from Utility.dbo.MyDB_RowCnt
where flag ='OLD';
update Utility.dbo.MyDB_RowCnt
set flag ='OLD'
where flag ='NEW';
INSERT INTO Utility.dbo.MyDB_RowCnt
Select 'NEW' as flag
,QUOTENAME(SCHEMA_NAME(sOBJ.schema_id)) + '.' + QUOTENAME(sOBJ.name) AS [TableName]
,...
December 18, 2014 at 6:57 am
Look at Forecasting with SQL By Mark Wojciechowicz,
December 18, 2014 at 2:07 am
Taking x_Specify columns into account
--USE <your DB name>;
GO
IF object_id(N'dbo.BadTox', 'U') IS NOT NULL
DROP TABLE [dbo].[BadTox];
GO
CREATE TABLE [dbo].[BadTox](
[PatientID] [int] NULL,
[Cycle] [tinyint] NULL,
[ALOPECIA] [tinyint] NULL,
[Causality1] [tinyint] NULL,
[Relatedness1] [tinyint] NULL,
BONE TINYINT,
Bone_Specify VARCHAR(50),
[Causality2]...
December 18, 2014 at 12:39 am
Try this.
--USE <your DB name>;
GO
IF object_id(N'dbo.BadTox', 'U') IS NOT NULL
DROP TABLE [dbo].[BadTox];
GO
CREATE TABLE [dbo].[BadTox](
[PatientID] [int] NULL,
[Cycle] [tinyint] NULL,
[ALOPECIA] [tinyint] NULL,
[Causality1] [tinyint] NULL,
[Relatedness1] [tinyint] NULL,
[BLOOD] [tinyint] NULL,
[Causality2] [tinyint] NULL,
[Relatedness2] [tinyint]...
December 18, 2014 at 12:10 am
May be compute some statistics over a period. For example number of debt values where
n0: debt =0,
n1: 0 < debt <= past week amout,
n4: past week amout< debt <= past...
December 17, 2014 at 7:09 am
If the structure of BadTox is fixed and is exactly as it is in your post,
then you needn't anylize system dictionary.
Just
SELECT ups.PatientID
, ups.Cycle
, CrossApplied.SymptomName
, CrossApplied.Toxicity
, CrossApplied.Causality
, CrossApplied.Relatedness
FROM [dbo].[BadTox] ups
CROSS...
December 17, 2014 at 2:12 am
When 'freezing' new development i'd freeze XP_cmdshell first of all, i should say. 🙂
Obvious reasons why performance slightly degrades are
1.Every time you run new sqlcmd instance it creates new...
December 17, 2014 at 1:25 am
This supports only 4 rules you have mentioned. No '()', '-' or whitespaces allowed.
declare @s-2 varchar(50) = 'fd123456asa789013dfd';
select @s-2
, f.Flag
...
December 15, 2014 at 6:01 am
Replacing (VAL2) with ISNULL(VAL2,1) will do the trick.
But wait a moment, VAL1/NULLIF((VAL2),0) should never raise 'divide by zero' error. Are you sure it's exactly the expression which causes...
December 15, 2014 at 1:22 am
First question, why you have Wharehouses ('Whs') in SELECT ... GROUP BY in CTEs (SAP, Accellos) and do not join grouped data by warehouses?
Suppose you just omit...
December 12, 2014 at 5:03 am
On 2012+ you may also want to use analytics with windowing.
declare @prm datetime = '2014-12-04 12:00';
select distinct
PK = LAST_VALUE(PK) OVER ( PARTITION BY Prod, Terminal ORDER...
December 12, 2014 at 3:00 am
Viewing 15 posts - 271 through 285 (of 444 total)