Forum Replies Created

Viewing 15 posts - 2,086 through 2,100 (of 2,458 total)

  • RE: running tsql from filetable

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Problem with grouping in SSRS 2008

    joe.wolfe (10/11/2013)


    Thank you for responding to my question and I apologize for taking so long to reply back. I had to have some emergency foot surgery.

    I am in fact...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Fragmentation doesn't changes after index rebuilding

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: String Split and LEFT OUTER JOIN in Two Tables

    Misread OP. Comment removed.:blush:

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Reading XML from column

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: how to generate dates from sql query in a set of 4

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: creating user databases on ssrs server

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Render XML report using XSL transform

    danka_6786978 (7/24/2013)


    Hi, I am upgrading reports from 2005 to 2008R2 and I noticed that two reports are failing on the new server. So, after looking up its issue, I realized...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How about a Stairway to CLR series

    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.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Need TSQL help to monitor the scheduled jobs in SQL 2012

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: why used WITH XMLNAMESPACES in tsql ?

    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:...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: import string with array into table

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How do you map to rows inside different branches of same XML document using OPENXML rowset function?

    LutzM (10/7/2013)


    Here's a slightly different approach without the OPENXML approach (I, personally, find OPENXML more complicted and it seems to be less efficient in most cases):

    SELECT

    TempXML1.Node1.value('(server/text())[1]', 'varchar(50)') AS [server],...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How do you map to rows inside different branches of same XML document using OPENXML rowset function?

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Paramater Concatenation

    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...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 15 posts - 2,086 through 2,100 (of 2,458 total)