Forum Replies Created

Viewing 15 posts - 151 through 165 (of 530 total)

  • RE: Insert SQL statement into a table

    Still don't see the problem with the quotes (well, depending on your environment).

    In Visual Basic you would do something like :

    
    
    Dim oCmd as new ADODB.Command
    Dim oParam...
  • RE: Insert SQL statement into a table

    Normally, this should not be a problem if you can execute stored procedures from the front-end you are using.

    If you pass in the SQL string as a parameter, SQL Server...

  • RE: Wierd convert problem

    I do believe it should not be necessary to convert to a number to do a sort. String sorting should work fine, except when you are having troubles with leading...

  • RE: Query Joins

    From BOL (for SQL2K)...

    quote:


    Remarks

    A view can reference a maximum of 1,024 columns.


    So that...

  • RE: INNER JOINS

    Agree with Mark.

    This is most probably an issue with your data itself. Check if there are no duplicates in the linked tables somewhere.

    To easily find those, you can execute the...

  • RE: Select T1.Field, count(T2.Field) help

    Other solution

    
    
    SELECT C.*, O.NrOfRecords
    FROM Customers C
    LEFT OUTER JOIN
    (SELECT CustomerID,
    ...
  • RE: Nested subqueries

    Stupid me.

    You will have to add a group by to the first 'table' in the FROM like so

    
    
    ...
    FROM (SELECT CustomerID FROM Orders GROUP BY CustomerID) M
    ...
  • RE: SQL statement

    I came up with this solution...

    
    
    --Temp table to hold the criteria
    CREATE TABLE #NrPct
    (NrOfTests int,
    Pct int)
    --Insert the criteria in the table
    INSERT INTO #NrPct (NrOfTests,Pct)
    ...
  • RE: SQL statement

    Just read your post more carefully...

    quote:


    The nested Select dont work because the number of test and the percent can be any...

  • RE: SQL statement

    I guess you are looking for a AND in the query.

    Try this

    
    
    SELECT Student
    FROM TableA M
    WHERE EXISTS (SELECT 1 FROM TableA S1
    ...
  • RE: Tab delimited query results

    If your data contains spaces, they will be reproduced in the file.

    Otherwise, I don't see any problem with your approach.

  • RE: T-SQL

    You can't do this from standard T-SQL. The only way is to implement an extended stored procedure that spawns a separate thread. Don't know how to return a result set...

  • RE: Nested subqueries

    While you are testing for performance, try this. Wonder if it's better than CASE and the subqueries ...

    
    
    SELECT M.customerID,
    IsNull(T96.NumOrders,...
  • RE: Adding selects

    And add the date to that solution to yield

    
    
    SELECT item_no, date, sum(qty)
    FROM table
    GROUP BY item_no, date
  • RE: Help with result format

    A bit off-topic, but this kind of thing is more of a representation issue that is best solved using the client application. I know this is fairly easy done in...

Viewing 15 posts - 151 through 165 (of 530 total)