Viewing 15 posts - 1,951 through 1,965 (of 2,462 total)
clucasi (5/28/2014)
...the problem I am having is that the XML has two row nodes.
The deal with two nodes with the same name you could refer to them by their position....
-- Itzik Ben-Gan 2001
June 5, 2014 at 3:55 pm
Eirikur Eiriksson (5/28/2014)
😎
USE tempdb;
GO
DECLARE @TXML XML = N'<?xml version="1.0"?>
<CommonEventData>
<Row>
<CallSource>999</CallSource>
<CallerCityStateZipCode>
</CallerCityStateZipCode>
<CallerName>TEST</CallerName>
<CallerPhone>TEST</CallerPhone>
</Row>
<Row>
<Beat>E27</Beat>
<MultiEventId>0</MultiEventId>
<PrimaryUnitId>E09A1</PrimaryUnitId>
</Row>
</CommonEventData>'
SELECT
MAX(RO.W.value('CallSource[1]','NVARCHAR(50)') ...
-- Itzik Ben-Gan 2001
June 5, 2014 at 3:44 pm
You could go with:
SELECT cast(8999999*rand() as int)+1000000
For multiple rows you could go with:
SELECT cast(8999999*rand(cast(newid() AS varbinary)) as int)+1000000
FROM <something>
Edit: typo
-- Itzik Ben-Gan 2001
June 5, 2014 at 1:27 pm
I just read this. Great work Don. Very thorough and a really good read. I am looking forward to the rest of the SQL Server Security stairways!
-- Itzik Ben-Gan 2001
June 4, 2014 at 6:32 am
DDL is always helpful for getting a good answer faster.
Below is the DDL and solution to your problem. Note that some columns are not necessary; I included them so...
-- Itzik Ben-Gan 2001
May 29, 2014 at 1:15 pm
I would start with The Microsoft Data Warehouse Toolkit: With SQL Server 2008 R2 and the Microsoft Business Intelligence Toolset.
Though the book is based on the SQL Server 2008...
-- Itzik Ben-Gan 2001
May 29, 2014 at 6:28 am
ricardo_chicas (5/23/2014)
I am using sql server 2008 r2 sp 10
I have a database that originally consumed 500gb, I truncated most of the tables and now the biggest table consume around...
-- Itzik Ben-Gan 2001
May 23, 2014 at 12:16 pm
Please include some DDL next to so as to get a faster response (note the link in my signature for getting help here).
That said, I think this is what...
-- Itzik Ben-Gan 2001
May 22, 2014 at 2:12 pm
mickyT (5/20/2014)
Here's another method using the same splitter and with the same conditions as Alan's. I though cube may give you the results you need
declare @string varchar(500) = 'Carborator...
-- Itzik Ben-Gan 2001
May 20, 2014 at 1:58 pm
Megha P (5/20/2014)
once again thanks..your code works correctly :-).
meanwhile i come up with below code..just to share
/* Data generation for #LocalTempTable */
DECLARE @Date1 datetime
DECLARE @Date2 datetime
SET @Date2...
-- Itzik Ben-Gan 2001
May 20, 2014 at 11:56 am
Using the splitter function referenced in my signature you could do this.
declare @string varchar(500) = 'Carborator Break Engine Oil';
declare @tblPattern table (ID INT IDENTITY, Pattern VARCHAR(500), PatternIdentifier INT);
;WITH split1 AS...
-- Itzik Ben-Gan 2001
May 20, 2014 at 11:15 am
davoscollective (5/19/2014)
Alan.B (5/18/2014)
-- Itzik Ben-Gan 2001
May 20, 2014 at 8:42 am
I did not address the weekend requirement but came up with something that will calculate days, hours and minutes. The only thing left to do is calclulate how much of...
-- Itzik Ben-Gan 2001
May 19, 2014 at 11:06 am
Your update query should be fine and, no, it does not matter if you include the table in the FROM or table operator clauses (e.g. JOIN & APPLY).
With the...
-- Itzik Ben-Gan 2001
May 18, 2014 at 5:41 pm
Taking it one step further...
DECLARE @dt DATETIME;
SET @dt = '2014-04-01';
SELECT left(DATENAME(month,@dt),3)+'-'+ right(YEAR(@dt),2)
-- Itzik Ben-Gan 2001
May 16, 2014 at 9:10 am
Viewing 15 posts - 1,951 through 1,965 (of 2,462 total)