Forum Replies Created

Viewing 15 posts - 1,516 through 1,530 (of 2,462 total)

  • RE: Index on calculated field with UDF?

    Jeff Moden (5/11/2015)


    Alan.B (5/11/2015)


    Yes and Yes no. If you post an example of what you are trying to do specifically we can provide a specific example.

    If you are talking about...

    "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: Query

    Glad that worked. Happy to help.

    "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: Using like to identify a value that contains alpha-numeric values other thna A-Z

    spaghettidba (5/11/2015)


    LIKE would do as well:

    WHERE ex NOT LIKE '%[^A-G0-9]%'

    ... and would be better than what I posted. I have not finished my coffee this morning and need to do...

    "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: Index on calculated field with UDF?

    Yes and Yes no. If you post an example of what you are trying to do specifically we can provide a specific example.

    If you are talking about doing something like...

    "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: TRUNCATING MULTIPLE TABLES

    What have you tried?

    For scripting multiple tables to be trunctated it would be something like this:

    TRUNCATE <Table1>;

    TRUNCATE <Table2>;

    TRUNCATE <Table3>;

    TRUNCATE <Table4>;

    --etc...

    For...

    "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: Using like to identify a value that contains alpha-numeric values other thna A-Z

    I don't 100% understand your question but think that PATINDEX will help if you're asking what I think you're asking...

    You want fields that only contain the letters A through G...

    "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: Dynamically changing parameters in the linked report

    The best way would be to have a second parameter that allows the user to specify what they want (first day of the month, week, etc) then have the next...

    "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: Query

    First, Month and Year are terrible field names. Second, Splitting date attributes into separate columns is a bad idea.

    Using your original sample data you could do this:

    DECLARE @yourData AS...

    "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 reports

    I agree, no problem. Here's a good MSDN page that talks about what to look out for.

    https://msdn.microsoft.com/en-us/library/ms143674(v=sql.110).aspx

    I will add that anytime you upgrade your reports to a new version...

    "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: Get rows and sum in joined table

    Yes, paging can be done in T-SQL. Below is some sample data and two examples of how to do it.

    -- Sample Data

    DECLARE @sales TABLE

    (

    sale_id int primary...

    "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: Execution Plan Question

    Are the [predicates] the columns in the WHERE clause of a SELECT statement?

    There is no WHERE clause in a SELECT statement. There is a WHERE clause in a SQL...

    "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: I need a list of best books on SSAS.

    I would start with the The Microsoft Data Warehouse Toolkit, Second Edition: With SQL Server 2008[/url]

    Great books for SSAS and MDX specifically are the "Step by Step" books.

    SQLServerCentral...

    "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: Combine the functionality of IN and LIKE in a WHERE clause

    How about...

    WITH containsString AS (SELECT string FROM (VALUES ('% sports %'),('% exercise %'),('%toy%')) t(string))

    SELECT DISTINCT c.Name

    FROM Sales.Store c

    JOIN containsString cs ON c.Name LIKE cs.string

    Quick edit: Did not see Nevyn or...

    "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: Count Null values in all columns in a table and group it by a column

    My question is why do you care how many rows of each column have NULL?

    That does seem like an odd requirement.

    "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: Certification path for the Accidental DBA?

    cppwiz (5/8/2015)


    Let me suggest two alternatives to boot camps:

    PASS Summit 2015

    SQL Cruise[/url]

    Neither of these will directly prepare you for certification, but they will give you a much broader learning opportunity....

    "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 - 1,516 through 1,530 (of 2,462 total)