Forum Replies Created

Viewing 15 posts - 4,741 through 4,755 (of 8,731 total)

  • RE: Parameters

    That's exactly what it will do to prevent sending blanks when you intend sending nulls. You can change that if you're certain that you'll only receive nulls to compare as...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: expanding the keyword AS

    frdrckmitchell7 (7/9/2015)


    Thanks Louis, I will see if there is something on SSIS/SSAS that I can use.

    Using a column that might vary its name from one run to the other is...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Parameters

    Maybe you could use dynamic sql for better results as shown in this article: http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/

    Or you could simply go like this:

    WHERE parameter1 = @parameter1

    AND (parameter2 = @parameter2 OR ISNULL(@parameter2,'')...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Parameters

    That seems to be because the NULL checkbox isn't selected. You could allow blanks to prevent this problem.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Indexes design advice

    haiao2000 (7/8/2015)


    Thanks for following up. I came cross an instance that we have to update and delete 20+ millions of records from the table. and that has been extremely slow,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Update and Except question.

    I'd use a suggestion very similar to Leo's code. I'm not sure if that's the update format that can cause unexpected performance problems with no logical reason.

    UPDATE o

    SET obsolete =...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Merge multiple rows in single row

    Actually, you don't need it. Just create it on the fly as part of the query.

    WITH CTE AS(

    SELECT p.Prefix

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pivot help to exclude matching field

    I use the IFCode tags which are visible to the left of the message text box. For SQL code, I use the [ code="sql"][/code] with no space. You can also...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pivot help to exclude matching field

    I'm not sure which of the 2 HAVING clauses you need so I'm including both so you can test.

    I also changed the pivot approach to a cross tabs which is...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: expanding the keyword AS

    If you're using something else for the front-end, such as SSRS or any other reporting tool, you should format the label on that tool. It's a lot easier to maintain...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Split postal code range into single row

    After you understand how a tally table works, you can play with other variants such as views or functions which might include zero reads.

    CREATE FUNCTION dbo.NumbersRange

    ( ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Validate only single date filed in the file in ssis

    It depends.

    The best way would be to have your DOB column in your table as a date data type. This will validate that the data is correct and generate an...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: sql to identify db objects that depend on a particular table?

    mtlsql (7/7/2015)


    You can also query sys.sydepends for more information. This is nice since you can join to it in SQL statements, unlike a stored procedure. There's more info at:

    https://msdn.microsoft.com/en-us/library/ms190325.aspx

    Which is...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: table migration question

    sqlguy-736318 (7/7/2015)


    I want to migrate the full table definitions, table data and dependent objects. This needs to be done through a sql script as opposed to SSIS. Can...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: sql to identify db objects that depend on a particular table?

    Are you looking for something like this?

    EXEC sp_depends 'Schema.Object'

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 4,741 through 4,755 (of 8,731 total)