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 SkipVought 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: *

  1. jaywalk

    CHARINDEX vs LIKE ... in a WHERE clause

    I ran a couple of quick tests against a fully indexed table with 1.3 million rows, and it does appear that for your example charindex is quicker. Like: 5 seconds (avg over 10 runs) Charindex: 4 seconds (avg over 10 runs) However, for searches on beginning of data, like outperformed patindex...
  2. jaywalk

    Find Number of Rows in User Tables

    I have a ridiculously large database at work, with a multitude of tables, and had the same problem. However, using a select count(*) from tablename wasn't terribly efficient, so I ran sp_spaceused instead, which is fine in most cases: CREATE TABLE #spaceused (name varchar(20), rows int...
  3. jaywalk

    Evaluating NULL in SP WHERE clause

    If you want the search to return any values of subid if you pass in NULL, then: SELECT * FROM tbl WHERE MainID = @MainID AND SubID = ISNULL(@SubID, SubID) If you want the search to return only those matching NULL, then you could try: SELECT * FROM tbl WHERE MainID = @MainID AND ISNULL(SubID...

Part and Inventory Search

Back
Top