Forum Replies Created

Viewing 15 posts - 1,801 through 1,815 (of 3,544 total)

  • RE: Dynamic database name

    EXECUTE('select * from [' @dbname '].dbo.sysfiles')
    to stop sql injection attack

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Can this Update Query be Tuned ?

    I have some issues with the logic

    What is the column COUNTER set to in #DATA before the update?

        WHERE D.COUNTER < 11

        AND D.COUNTER >= 1

    this will retrict the selection...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Expected error not raised

    Nice one Andy

    After I posted I thought of posting similar but didn't

    If the input is greater...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Expected error not raised

    You cannot trap this error in sp only the application, SQL Server will not execute any statement following this type of error.

    The only exception may be SQL 2005 with TRY...CATCH

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: query to search through different servers

    It works for me with SQL2K

    Did you copy and paste the query as is?

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: problem with apostrophes and ordering

    See

    http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B305704

    Alternate to what is suggested you could try

    ORDER BY ASCII(LOWER([name])), [name]

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: problem with apostrophes and ordering

    No it doesn't but certain collations may make it look like it does.

    What is the default collation you using?

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: query to search through different servers

    Duplicate post. Answered in other one

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: query to search through different servers

    Run this

    SELECT 'EXEC ['+srvname+'].master.dbo.sp_Msforeachdb @command1 =

    "Select o.name,u.name,o.uid

    from [?]..sysusers u,[?]..sysobjects o

    where (u.name like ''%nko98766''

    and o.uid = u.uid)"'

    FROM master.dbo.sysservers

    WHERE isremote=1 AND srvproduct='SQL Server'

    paste the results...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Error 137 (not again!)

    You cannot use table variable names to specify columns you have to use an alias, like this

    DELETE b

    FROM @base b

    WHERE NOT EXISTS

    (SELECT GRP_NUM, SFX_NUM

    FROM tbl0020Subscriber AS...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Service Pack

    Refer to

    http://support.microsoft.com/kb/321185/

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Using top 5 max (as it were!)

    Put the results of your query into a temp table and use the following

    SELECT a.agtrefno,

    MAX(CASE WHEN a.[ID]=1 THEN a.memindex ELSE null END) AS [memindex1],

    MAX(CASE WHEN a.[ID]=2 THEN a.memindex...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: DISTINCT Values

    SELECT DISTINCT G1,G2,G3,G4

    FROM

    WHERE (G1 <> G2 AND G1 <> G3 AND G1 <> G4)

    AND (G2 <> G3 AND G2 <> G4)

    AND (G3 <> G4)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Help for query

    SELECT [Description], COUNT(*) AS [Count]

    FROM (SELECT DISTINCT [Description], empid, DATEADD(day,DATEDIFF(day,0,dt),0) AS [dt]

    FROM emp_amount) a

    GROUP BY [Description]

    What exactly do you mean by 'past 24 hours' ?

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: bulk insert

    Try

    EXEC('BULK INSERT EmpInput FROM ''E:\FileTransfers\Inputs\Emp\' + @FileName + '.txt''')

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 1,801 through 1,815 (of 3,544 total)