Forum Replies Created

Viewing 15 posts - 2,026 through 2,040 (of 2,462 total)

  • RE: how to display totals grand total in t-sql

    pietlinden (11/19/2013)


    If you're fairly new to SQL, I would do this in SSRS, because you can get SSRS to do pretty much all the hard work for you (sorting, grouping,...

    "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: Changing replication publication name

    No

    "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: Programmatically get SSRS Database Name

    This could do this trick:

    IF OBJECT_ID('tempdb..##ssrs_candidates') IS NOT NULL DROP TABLE ##ssrs_candidates;

    CREATE TABLE ##ssrs_candidates (c_id int identity, ssrs_db varchar(100));

    EXEC sp_msforeachdb'

    INSERT INTO ##ssrs_candidates

    SELECT TABLE_CATALOG

    FROM [?].information_schema.columns

    WHERETABLE_NAME =''Catalog''

    ANDCOLUMN_NAME =''ItemID''

    ANDORDINAL_POSITION =1

    ANDDATA_TYPE=''uniqueidentifier''

    '

    SELECT * FROM...

    "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: convert CSV file to XML file format based on XSD file using SSIS (SQL Server 2008R2)

    krish.sett (8/3/2011)


    Thanks for the info.....so basically i need to create a XSLT file for my XML file so that i can use XML Task Editor for the conversion.

    This is really...

    "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: Retrieve XML Code by API with Automatic Approach

    akirajt (11/19/2013)


    1. What component in SSIS do I need to retrieve the XML file, using API connection?

    You can use the SSIS XSLT task. It is not well documented but here...

    "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 display totals grand total in t-sql

    dastagiri16 (11/19/2013)


    hi,

    I have a table class

    classname section Marks

    -------------------------------------------

    first a ...

    "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: Exporting Maintenance plans

    Keeping in mind that maintenance plans are SSIS packages you could start here: Importing and Exporting Packages.

    In SQL Server 2008 Your maintenance plans usually live in msdb.dbo.sysssispackage.

    FYI: This...

    "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: (RVO) script runs 5 sec with hard-coded value - 45 sec using parameter!

    ahperez (11/14/2013)


    The optimizer doesn't know the value of the variable in the second query it is changing the query plan to use a clustered index scan rather than a seek...

    "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: (RVO) script runs 5 sec with hard-coded value - 45 sec using parameter!

    First, here's the problem (looking at the 45 sec plan):

    This looks like parameter sniffing; your cardinality estimates are messed. Your query is scanning an index that has 5M+ rows to...

    "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: Passing multiple values to a parameter in a stored produre

    Edward Boyle-478467 (11/14/2013)


    If OBJECT_ID('TEST_procedure','P') is not Null Drop procedure TEST_procedure

    Go

    create procedure TEST_procedure

    @exampleid XML

    as

    update tablea

    set text_field = 'Y'

    where

    example_id in (Select x.value('(.)','varchar(100)') from @exampleid.nodes('/List/Field/text()') as x(x))

    Go

    If object_id('tablea') is Not Null Drop...

    "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: Passing multiple values to a parameter in a stored produre

    subbareddy542 (11/13/2013)


    hi,

    first can u create one function to use below code.

    CREATE FUNCTION SPLIT(@VAL VARCHAR(MAX))

    RETURNS @T1 TABLE(COL1 VARCHAR(MAX))

    AS

    BEGIN

    WHILE CHARINDEX(',',@VAL)>0

    BEGIN

    INSERT INTO @T1 VALUES(SUBSTRING(@VAL,1,(CHARINDEX(',',@VAL))-1))

    SET @val=SUBSTRING(@VAL,(CHARINDEX(',',@VAL))+1,LEN(@VAL))

    END...

    "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: SSRS Query with hyperLink

    It sounds like you are trying to do a drill-through report. This should get you started:

    Drillthrough Reports (Report Builder 3.0 and SSRS)

    "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: Update values like Vlookup

    Dhruvesh Shah (11/12/2013)


    Hi,

    I have a table as per below.

    CREATE TABLE #TEMP

    (

    ID NVARCHAR(200) NOT NULL,

    SIMNO NVARCHAR(200) NULL,

    IMEI NVARCHAR(200) NULL

    )

    iNSERT INTO #TEMP VALUES ('0412345678','0412345678','013275009174916')

    iNSERT INTO #TEMP VALUES ('013275009174916','0412345678','')

    iNSERT INTO...

    "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: sQL 2008 VS 2012

    Shaun2012 (11/12/2013)


    We are moving from SQL 2008 to 2012. What are the big differences... As we have lot of packages around 30-40. To migrate these packages into 2008, what should...

    "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: Stuck with an xml nodes query

    Paul Treston (11/11/2013)


    Hello there,

    I'm currently working on extracting a load of xml elements out of a dynamic blob of xml. I have over 100 columns nailed down but 1 column...

    "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,026 through 2,040 (of 2,462 total)