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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by SleepingSand

  1. SleepingSand

    Select rows numbers x to x+y

    Hi, If the query is written in the following format then the problem can be solved. SELECT * FROM Table_Name AS MyAlias WHERE (SELECT COUNT(1) FROM Table_Name WHERE Primary_Key_ID <= MyAlias.Primary_Key_ID) BETWEEN 16 AND 20 write back on doubt. thanks. Sandeep
  2. SleepingSand

    CONVERTING MS ACCESS 2000 TO SQL SERVER, WHERE TO BEGIN?

    See Microsoft knowledge base article Q152032 for additional information. Moving to SQL Server will depend a bit on what version of Access you're using. With Access 95, download the upsizing wizard from the Access portion of the Microsoft site ( http://www.microsoft.com/access, or directly here)...
  3. SleepingSand

    User Defined Function

    I m using SQL Server 2000, and it is working perfectly. I have checked it by creating your tables and with some sample data.
  4. SleepingSand

    SELECT (approx) TOP 33.3 PERCENT...

    Since the table structure is not known to me thats why I cant give u the exact query... but u can use the following logic --------------------------------------------------- SELECT * FROM Orders A WHERE (SELECT COUNT(*) FROM Orders WHERE OrderID < A.OrderID ) / 3 * 100 < 33.3...
  5. SleepingSand

    User Defined Function

    Ooooooooops !!!! SORRY... Some change... in the second last line. ------------------------------------------------------ DECLARE @Consultant varchar(255) SELECT @Consultant = COALESCE(@Consultant + ', ', ' ') + strConsultantName FROM project, projectConsultant, Consultant WHERE...
  6. SleepingSand

    User Defined Function

    Since, Creation of CURSOR is a overhead to the system, it will hinder in performance. Please check the following solution. ------------------------------------------------------ DECLARE @Consultant varchar(255) SELECT @Consultant = COALESCE(@Consultant + ', ', ' ') + strConsultantName FROM...
  7. SleepingSand

    Reading from One Table

    Are you trying to get the result for this Self Related Table in the form of a Tree Structure ?
  8. SleepingSand

    deadlocks

    The following is just CUT and PASTE from www.sql-server-performance.com Here are some tips on how to avoid deadlocking on your SQL Server: · Ensure the database design is properly normalized. · Have the application access server objects in the same order each time. · During transactions, don't...
  9. SleepingSand

    how to get multiple records into one

    Use it like it... DECLARE @mComment varchar(500) SELECT @mComment = COALESCE(@mComment, ' ') + Comment FROM Table1 SELECT DISTINCT req, @mComment FROM Table1 This should work... Please check out.

Part and Inventory Search

Back
Top