Forum Replies Created

Viewing 15 posts - 8,641 through 8,655 (of 10,144 total)

  • RE: Long running queries when using DISTINCT with Strings

    Can you tell us something about the distribution of values in column1? Does the column have unique values which could be omitted from your process?

  • RE: Update int field with Datediff in subquery?

    dji (3/26/2009)


    Blimey! That looks impressive.

    I have copied the code and will have a play around as I really do need to get on top of T-SQL instead of writing apps...

  • RE: Update int field with Datediff in subquery?

    Here's a simple way of doing it:-- set up some sample data

    DROP TABLE #MstHorse

    CREATE TABLE #MstHorse (HorseID INT, HorseName VARCHAR(30))

    INSERT INTO #MstHorse (HorseID, HorseName)

    SELECT 1, 'Red Rum' UNION ALL

    SELECT 2,...

  • RE: top - 1 ROW !

    Here's the old-fashioned way:

    DROP TABLE #temp

    CREATE TABLE #temp ([pk id] INT, numero INT, statut INT, majdate DATETIME)

    INSERT INTO #temp

    ([pk id], numero, statut, majdate)

    SELECT 2480, 202, 0, '2009-03-26 08:15:55.00' UNION ALL

    SELECT...

  • RE: Openrowset Error

    Some of your commas are a little random. Try the first query, if this works, try the second.

    SELECT *

    FROM OPENROWSET('SQLNCLI',

    'Server= anyserver;Trusted_Connection=yes; Initial Catalog=anydb',

    'SELECT GETDATE()')

    SELECT *

    FROM OPENROWSET('SQLNCLI',

    'Server= anyserver;Trusted_Connection=yes; Initial...

  • RE: Automatically change LOWER to UPPER

    Why not do this client-side? It's formatting, after all.

  • RE: Long running queries when using DISTINCT with Strings

    musab (3/26/2009)


    Hi !

    I am using data type nvarchar(max) and have 13 million records and want to get unique records out of it based on the text.

    but the query...

  • RE: top - 1 ROW !

    christophe.bernard (3/26/2009)


    pk id numero ...

  • RE: Large Data Set Returns Faster Than Small?

    Can you post the code for the procedure please?

  • RE: Are the posted questions getting worse?

    Kit G (3/24/2009)


    Yeah, I have to agree with Bob. I'm new to SQL and CR's help didn't make much sense to me. Had it been me getting that,...

  • RE: SQL GROUP statement

    munderhill73525 (3/24/2009)


    The "root" of my problem is the assignment itself. It specifically states to use GROUP BY statements to accomplish the scenarios which in turn has me TOTALLY confused!!...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (3/24/2009)


    Is it me or are the people we are trying to help just getting dumber, or do we need to start commenting are code a lot more heavily?

    Hell...

  • RE: Are the posted questions getting worse?

    Kit G (3/24/2009)


    Roy Ernest (3/24/2009)


    I guess I am the shortest here...:-) I am just 5'6". 😀

    The chance of meeting anyone from THE THREAD is very remote for me since I...

  • RE: SQL GROUP statement

    It seems you're confusing "group the employees together by some attribute" (which you would achieve with ORDER BY) with sql GROUP BY, which is something quite different - usually used...

  • RE: SQL GROUP statement

    Select Last_name,Salary,EE01_Classification

    FROM Employees

    WHERE Salary IN (SELECT Salary

    FROM Employees

    GROUP BY EE01_Classification,Salary)

    ORDER BY EE01_Classification;

    This means:

    Select Last_name,Salary,EE01_Classification

    FROM Employees

    WHERE Salary IN (all employee salaries)

    ORDER BY EE01_Classification;

    Which is the same as:

    Select Last_name,Salary,EE01_Classification

    FROM Employees

    WHERE 1 =...

Viewing 15 posts - 8,641 through 8,655 (of 10,144 total)