Forum Replies Created

Viewing 15 posts - 91 through 105 (of 154 total)

  • RE: Deleting duplicate Records??

    if this is a one-time job you can add a identity column and run this query

    DELETE Customers

    FROM Customers

    WHERE Identid NOT IN

    (

    SELECT Min(Identid)

    FROM Customers

    GROUP BY CUSTID

    )

    ...

  • RE: Extended property Description

    SELECT SysProperties.Value

    FROMSysProperties

    INNER JOIN SysColumns ON SysProperties.id = SysColumns.id AND

    SysColumns.colid = SysProperties.smallid

    WHERE (SysProperties.name = 'MS_Description') AND

    (Object_name(Syscolumns.id) = <TableName>) AND

    (SysColumns.Name = <Columnname>)

  • RE: Slow 1st Insert in ## table

    seems like the procedure might be being recompiled every time its run..can you post the SQL

  • RE: Text Export

    here's something

    DECLARE @StrLen int

    DECLARE @ptr binary(16)

    CREATE TABLE #TEST

    (

    cnt int ,

    textstr text

    )

    INSERT INTO #TEST

    VALUES (1,REPLICATE('AB',10))

    SELECT *

    FROM #TEST

    SELECT @Ptr = TEXTPTR (textstr)

    FROM #TEST

    WHERE cnt = 1

    UPDATETEXT #TEST.textstr...

  • RE: Join, Group by: can't have it right

    Does this work for you

    SELECT City.City_Id, City.City_Name,

    News.iYear, News.iMonth , News.NewsCount

    FROM City

    LEFT OUTER JOIN

    ( ...

  • RE: SQL server in USA - Datetime format problems...

    sorry British English

  • RE: SQL server in USA - Datetime format problems...

    try running sp_configure to change the default language to US English

  • RE: What rules of thumb you live by when programming?

    remember to put that WHERE clause in the DELETE ... 🙂

    had a few scary ones with that

  • RE: Assigning value of a search

    why don't you try sp_executesql

    here's an example for the pubs database

    DECLARE @Qtyint,

    @Sqlnvarchar(100),

    @Defnvarchar(50)

    SET @Sql = 'SELECT @Qty = sum(qty) FROM Sales'

    SET @Def = '@Qty int output'

    EXEC Sp_ExecuteSql @Sql , @Def ,...

  • RE: Acheiving a lock through a cursor

    use the SCROLL_LOCKS option while declaring the cursor , this

    creates a lock on the current record when the cursor is being processed

    Hope this helps

  • RE: Here is an ordering question for ya....

    this should work

    CREATE TABLE #IPS

    (

    ipvarchar(20)

    )

    INSERT INTO #IPS

    VALUES ('123.45.0.1')

    INSERT INTO #IPS

    VALUES ('123.45.0.2')

    INSERT INTO #IPS

    VALUES ('123.45.0.102')

    SELECT *

    FROM #IPS

    ORDER BY CAST (SUBSTRING (ip,10,3) As smallint)

    DROP TABLE #IPS

  • RE: Date Format

    hello,

    first of all have you checked this from the frontend point of view.

    if you're running IIS check the regional settings of the server , if not the settings on the...

  • RE: Create Date Table between Start and End

    will this solution work??

    SELECT DATEADD(dd,Numbers.Num,'2001-01-01')

    FROM

    (

    SELECT Tens.Num + Hundreds.Num As Num

    FROM

    (

    SELECT 0 AS Num UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION...

  • RE: Why did you decide to become a DBA/SQL Programmer?

    I Started Off as a developer in Powerbuilder 2 1/2 years ago , moved to another

    company after a year , after doing a couple of projects the company decided...

  • RE: What do you like best about databases?

    sorry did'nt mean it that way, no offense meant we all love sql server , don't we

Viewing 15 posts - 91 through 105 (of 154 total)