Viewing 15 posts - 2,086 through 2,100 (of 2,458 total)
I have used the filetable to store the tsql scripts. what can be the best way to run them against the server. the only road block i have using the...
October 11, 2013 at 3:43 pm
joe.wolfe (10/11/2013)
I am in fact...
October 11, 2013 at 2:09 pm
sandeep singh-337370 (10/11/2013)
Guys,One of the other project's guys in my company asked me to improve the performance of their databases.
Keeping your indexes un-fragmented will help performance. That said, I...
October 11, 2013 at 1:14 pm
Misread OP. Comment removed.:blush:
October 9, 2013 at 2:56 pm
cor_perlee (6/17/2013)
It worked!Thanks so much. Really appreciate it 🙂
Cheers!
I know I am a little late here but this:
;with xmlnamespaces (default 'urn:vim25')
select t.c.value('(shares)[1]', 'varchar(200)')
from (table)
cross apply @xml.nodes('(/obj/cpuAllocation/shares, /obj/memoryAllocation/shares)') t(c)
is getting all...
October 9, 2013 at 2:45 pm
Koen's query produces a better query plan than what I came up with. That said, this is a good example of how to use NTILE for this type of thing...
DECLARE...
October 9, 2013 at 11:29 am
You are describing the thing that SSIS was designed to do. I don't see anything wrong with that provided you are using SSIS according to a set of best security...
October 9, 2013 at 11:00 am
danka_6786978 (7/24/2013)
October 8, 2013 at 4:26 pm
nick.gekas (4/2/2013)
Hi,I've enjoyed several of the Stairway series to date. I'm just wondering if you could provide one on creating CLR stored procs and UDFs?
Nick
+1 Absolutely! I second your suggestion.
October 8, 2013 at 3:33 pm
I'm going to take a quick stab at this since nobody has responded yet. What I am showing you here is not a complete solution but should get you moving...
October 8, 2013 at 1:37 pm
This is a super-simple, but great overview of XML Namespaces
http://www.w3schools.com/xml/xml_namespaces.asp
This article is great for understanding why they exist.
http://msdn.microsoft.com/en-us/magazine/cc302166.aspx
The W3C formal definition (if you ever have problems falling asleep)
http://www.w3.org/TR/REC-xml-names/%5B/url%5D
Edit:...
October 8, 2013 at 10:42 am
You can also use PatternSplitCM (note the link in my signature)....
declare @val varchar(8000)= '[{mark,peters,mr}{jane,fonda,mrs}{john,doo,mr}{james,bond,mr}]';
WITH x AS
(
SELECT ItemNumber, Item
FROM dbo.PatternSplitCM(REPLACE(REPLACE(@val,'[{',''),'}]',''),'%[}{]%')
WHERE Matched=0
)
SELECTROW_NUMBER() OVER (ORDER BY x.ItemNumber) AS Id,
MAX(CASE WHEN ps.ItemNumber=1 THEN...
October 7, 2013 at 4:24 pm
LutzM (10/7/2013)
SELECT
TempXML1.Node1.value('(server/text())[1]', 'varchar(50)') AS [server],...
October 7, 2013 at 12:35 pm
This is what you are looking for
EXEC sp_xml_preparedocument @dochandle OUTPUT, @xmldocument;
SELECT
server,
name,
start_time,
type,
log_name,
media_mount_date,
drive_name,
media_label,
media_guid,
media_overwrite_date,
media_append_date,
media_set_target
FROM OPENXML(@dochandle, 'joblog', 1)
WITH
(
server [varchar](20) 'header/server/text()',
name [varchar](300) 'header/name/text()',
start_time [varchar](100) 'header/start_time/text()',
type varchar(20) 'header/type/text()',
log_name...
October 7, 2013 at 12:11 pm
You can include table names or derived tables in your from clause but not a non-static value. Dynamic SQL (using sp_executesql not EXEC) is the way to go for this.There...
October 3, 2013 at 4:23 pm
Viewing 15 posts - 2,086 through 2,100 (of 2,458 total)