Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: katbear
  • Content: Threads
  • Order by date
  1. katbear

    Need math syntax :-)

    Hi, I need some SQL syntax to do the following: Compare 2 integer values (from 2 different tables) and make sure that the values DO NOT DIFFER by more than 10%. Not sure how to write this! Thanks
  2. katbear

    "LIKE" clause and performance

    I seem to have narrowed down the performance problem somewhat. Seems to be tied to a "like" clause, e.g. ... AND e.myCol LIKE CASE @myParam WHEN '<All>' THEN '%' ELSE @myParam END If I specify NULL for @myParam, the query runs in 15 seconds. If I specifiy a value for @myParam...
  3. katbear

    Help, queries perform differently on 2005!

    I have 2 servers, one is 2000, the other is 2005, sp1. The databases are identical, because I am restoring the database from the 2000 server onto the 2005 server. I am running some stored procs on both servers. They take about 30 seconds on 2000. However, on 2005, they are taking like over 15...
  4. katbear

    capturing result set output into a variable?

    Never thought about this before. But I'm calling a stored proc from a stored proc. The inside proc returns a couple rows to the screen, like this: This is the sp output... NULL I want to capture the first row (message) into a variable. How would I do this?? Thanks much
  5. katbear

    Question about sp_addlinkedsrvlogin

    Hi, I realize that I don't really understand how sp_addlinkedsrvlogin works. If you have a local user that you want to be able to log on to a remote (linked) server, does that user also have to exist on the remote server? Or if by using sp_addlinkedsrvlogin, does it enable the local user to...
  6. katbear

    Hash Match performance problem

    Hi, I have a part of a query that is quite expensive: LEFT JOIN myTable t1 ON t1.SyId = pos.SyId and t1.CuId = cu.CuId and t1.Date = @AsOfDate LEFT JOIN myTable t2 ON t2.SyId = pos.SyId and t2.CuId = cu.CuId and t2.Date = @StartDate-1 LEFT JOIN myTable t3...
  7. katbear

    xp_cmdshell permissions problem

    Hi, RE: SQL Server 2005 Is anyone familiar with this error message? A non-sysadmin user received this error. Running sp_xp_cmdshell_proxy_account solved the problem. Does this mean that ALL non-sysadmin users must have proxy accounts in order to use xp_cmdshell? Or is there something...
  8. katbear

    Need help with renaming file!

    Hi, This is not a sql server question, per se, but everyone here is so helpful I figured it would be a good place to ask! I have an extract that is named like: myFile.txt.pgp.20070820 It's stupid because the timestamp is AFTER the .pgp extension. However, that is how it is and I can't change...
  9. katbear

    applying sp2

    Hi, Is there a link that discusses best practices when applying sp2 for sql server 2005? I've never done this myself. Thanks
  10. katbear

    How to &quot;flip the sign&quot; of numbers in a table

    Hi, I have table where I need to reverse the signs of all the numbers in the table. e.g) 2,000 needs become -2,000 and -2,000 needs to become 2,000 Help... do I need a cursor to do this? Or is there an easier way?? Thanks
  11. katbear

    Query to detect existence of same data

    Hi, Basically, I want a query to detect if the data in TableA is the *exact same data* as in TableB, row for row, column for column. Help, is there a way to do this using SQL? Thank you
  12. katbear

    Help with dynamic SQL &amp; SET stmt

    Hi, I want to set the result of EXEC(@SQL) to a variable. That is, I want the MAX(ProductionDate) to be stored in a variable called @MaxTradeDate. It has to be dynamic because @myTable will be a parameter whose value will change. SET @SQL = 'SELECT MAX(ProductionDate) FROM ' + @myTable...
  13. katbear

    need syntax

    help What is the syntax for making a table column NOT NULL?? thanks
  14. katbear

    Help with CASE &amp; COALESCE

    Hi, Getting errors on: SELECT ab.ClosingBalance, CASE WHEN v1.Broker = 'Smith Barney' THEN NULL ELSE COALESCE(v1.Balance1, v2.Balance2) AS BegBalance END FROM myView1 v1 LEFT OUTER JOIN myView2 v2 ON v1.Broker = v2.Broker The error is: Msg 156, Level 15, State...
  15. katbear

    Need a &quot;system&quot; for removing old files

    This isn't a sql server question, per se, but it's definitely related to a sql server ssis project. Basically, every day I download a bunch of files from an ftp site using ssis. I want to keep 2 weeks worth of files. Sometimes I load the same files every day, for example: 8/3 download...
  16. katbear

    Need help with UPDATE &amp; JOIN

    Help. Can't figure this out. These queries *should* operate on the same number of rows but they don't: -- updates 2 rows begin tran UPDATE t1 SET t1.IndustryCode = t3.Industry FROM IndustryTable t1 JOIN CompanyTable t2 ON t1.IndustryID = t2.IndustryID JOIN CorrectTable t3 ON...
  17. katbear

    Need help w/ this query

    Hi, Here's my problem. I need to write a query that checks to see if some values do NOT exist in a table (as compared to another table). If they don't exist, I want the query to select the non-existing values in a "array", so that I can email the list. This is what I have so far, but it's...
  18. katbear

    DBCC REINDEX question

    I just want to verify: Running DBCC REINDEX *only* works if the table has a CLUSTERED index, correct? My testing shows that heap tables are not affected at all by reindexing. Just want to confirm this!!
  19. katbear

    Testing framework needed

    Hi, I am attempting to troubleshoot a "mysterious" performance problem. We have an Excel vba application that calls a function in SQL Server 2000. The function performs very differently from Excel than it does from QA. That is, it's a lot slower from Excel. Also, the performance changes due to...
  20. katbear

    Task pad view data - question

    Hi, Is there a way to see the same data one sees in TASK PAD (in 2000), as there is in 2005? I have (or had) a script that did this, but I can't find it now - arggghh. I just want to be able to see when the LAST LOG backup occurred, but task pad doesn't exist in 2005. Thanks

Part and Inventory Search

Back
Top