Forum Replies Created

Viewing 15 posts - 31 through 45 (of 1,183 total)

  • RE: Copying from SQLSMS grid, pasting in Excel, the word "NULL" is pasted!

    ALT + E + F + P does wonders. 😛

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need help for Non-Printable characters for decimal values in VARCHAR field

    As far as a SQL approach, here is something we use that you might find helpfull.

    1. You'll need a Tally table (we call it dbo.numbers ) ** search this site...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Performance tuning

    Sorry, one last change...

    EXEC [Myserver].db.dbo.DeleteUniqueKeys #DeleteKeys;

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Performance tuning

    Try this instead.....

    ---- on server B ([Myserver].db)

    ---- create a table type

    CREATE TYPE DeleteKeys AS TABLE

    (UniqueKey VARCHAR(10) PRIMARY KEY CLUSTERED)

    GO

    ---- create the procedure to accept the table valued parameter

    CREATE...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Performance tuning

    UniqueKey is not your problem.

    Think of it this way. Server A doesn't know anything about Server B's indexes or stats. A proper query plan can not be built because of...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Performance tuning

    mishrakanchan86 (8/5/2014)


    Is there anyway to improve performance of below linked query

    Delete from [Myserver].db.dbo.z2t where UniqueKey in (Select UniqueKey from #DeleteKeys where CAST(ZipCode AS INT) < 9999 )

    This takes more...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Sub Query

    I do wish that questions were at least reviewed before being posted.

    Questions like this completely invalidate the point system. IMHO 😀

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need new line in email address

    I can't verify, but try this ...

    =REPLACE(Fields!Email.Value,"@", vbCrLf & "@")

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Display One CompanyCode values instead of other companycode

    Thanks for the sample data. Next time (if you would please) try to provide it in a way similar to what I've done. This will, in more complex questions, save...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Check constraint on multiple columns

    Wrap your conditions in parenthesis and add an OR

    CREATE TABLE CheckConstraintTest

    (

    CTId INT NOT NULL ,

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Suggestions on how to improve this View that is using correlated subqueries

    T-SQL beginnger (7/16/2014)


    I actually changed it to t and sts aliases to PS later in the code and it works fine.

    I'm getting the same result set as original query.

    Thanks

    Not saying...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Suggestions on how to improve this View that is using correlated subqueries

    Jack Corbett (7/16/2014)


    I also think leveraging ROW_NUMBER to get to the most recent status row may be faster. I've seen examples where using row_number instead of MAX...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Suggestions on how to improve this View that is using correlated subqueries

    and another possible approach. ** although without test data I can't be sure. 🙂

    I'd also recommend coming up with another way to identify the data_set_nbr. That is what is really...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Create MERGE statements with data!

    For those of you that would like a single procedure that doesn't depend upon the Extended Properties and will work for a single table.

    Here's what we use:

    /****** Object: StoredProcedure...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Update Part of a SQL field with charindex

    Read up on STUFF .. http://msdn.microsoft.com/en-us/library/ms188043.aspx

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 15 posts - 31 through 45 (of 1,183 total)