Forum Replies Created

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

  • 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

  • RE: Are the posted questions getting worse?

    For anyone out there experienced with SQLIO can you chime in on this thread. I'm still learning and am not the best resource on this. Thanks!

    "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: IO bechmark

    mxy (5/7/2015)


    thanks Alan for your response. I have completed all the test runs with different block size, results see to be good (I don't know ;-))

    ex for 8k block...

    "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: Temporary Stored Procedures

    Interesting article. I learned something new this morning.

    "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: IO bechmark

    I just started working with SQLIO in the past couple months. I am no expert but found this article to be very helpful:

    http://blogs.technet.com/b/josebda/archive/2013/03/28/sqlio-powershell-and-storage-performance-measuring-iops-throughput-and-latency-for-both-local-disks-and-smb-file-shares.aspx

    "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,458 total)