Forum Replies Created

Viewing 15 posts - 2,041 through 2,055 (of 2,171 total)

  • RE: need a query to arrange ranks

    Something like this?

    -- prepare test data

    DECLARE @test-2 TABLE (SNO TINYINT, NAME VARCHAR, MARKS TINYINT)

    INSERT @test-2

    SELECT 1, 'A', 56 UNION ALL

    SELECT 2, 'B', 35 UNION ALL

    SELECT 3,...

  • RE: Adding columns to a table

    Something like this?

    DECLARE @test-2 TABLE (TimeSlot VARCHAR(10), C1 VARCHAR(10), C2 TINYINT)

    INSERT @Test

    SELECT 'Period1', 'Part 1', 2 UNION ALL

    SELECT 'Period2', 'Part 1', 4

    SELECT * FROM @test-2

    SELECT  C1,

      MAX(CASE...

  • RE: select date closest to today

    Doesn't matter, since the date picked is the latest date to the date given.

     

    How to select in the past (including today)

    DECLARE @WantedDate DATETIME

    SELECT @WantedDate = 'June 19,...

  • RE: select date closest to today

    How to select in the past (including today)

    SELECT HiD

    FROM   TheTable

    WHERE  HDate = (

                      SELECT MAX(HDate)

                      FROM   TheTable

                      WHERE  HDate < GETDATE()

                   )

    How...

  • RE: ADD another where clause?

    SELECT B.DESCR,

    SUM(CASE WHEN TO_CHAR(A.REQ_DT, 'YYYY') = TO_CHAR(SYSDATE, 'YYYY') THEN 1 ELSE 0 END) Reqs, SUM(CASE WHEN TO_CHAR(A.REQ_DT, 'YYYY') = TO_CHAR(SYSDATE, 'YYYY') THEN

    (CASE WHEN A.REQ_STATUS IN ('A', 'O') THEN...

  • RE: Length of a string

    Nice! Let's only hope that the first sequence of spaces does not equal 8000 spaces. Because that will produce the result of -1.

  • RE: port forwarding for SQL server2000?

    Have you read the license agreement? There is a $20,000 license fee (last time I checked, could be changed now) for using SQL server as backend to a public web...

  • RE: combine results of 2 stored procedures

    Create a table variable or temporary table and store the result for each store procedure. Then when done, UNION them together.

  • RE: need help with dynamic SQL

    CREATE PROCEDURE spSearch_For_Software @sTitle as VarChar(200),@sField as varchar(200)

    AS

    set nocount on

    declare @sSQL as varchar(200)

    set @sSQL = 'select * from [Club CDs] where [' + '' + @sField + '' +...

  • RE: Like and Sub Query

    What error do you get? "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the...

  • RE: Putting results into strings...

    Try this one for fun!

    SELECT    @WorkingString = ISNULL(@WorkingString + ', ', '') + CtrlCode

    FROM      #TempControls

    WHERE     CtrlCode LIKE 'T%'

    ORDER BY  1

  • RE: Server Unavailable

    Can be a number of sources for the error you experience.

    • Is IIS running?
    • Is there a session time-out?
    • Is network accesible?
    • Is DNS server functional?
  • RE: SQL 2005 Developer Error!!! Yikes.

    The IServiceProvider COM did not register correct.

    Merge your registry with this text (found on internet search).

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}]

    @="IServiceProvider"

    [HKEY_CLASSES_ROOT\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\NumMethods]

    @="4"

    [HKEY_CLASSES_ROOT\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\ProxyStubClsid32]

    @="{B8DA6310-E19B-11D0-933C-00A0C90DCAA9}"

    [HKEY_CURRENT_USER\Software\Classes\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}]

    @="IServiceProvider"

    [HKEY_CURRENT_USER\Software\Classes\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\NumMethods]

    @="4"

    [HKEY_CURRENT_USER\Software\Classes\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\ProxyStubClsid32]

    @="{B8DA6310-E19B-11D0-933C-00A0C90DCAA9}"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}]

    @="IServiceProvider"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\NumMethods]

    @="4"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\ProxyStubClsid32]

    @="{B8DA6310-E19B-11D0-933C-00A0C90DCAA9}"

    If that doesn't work, try to re-register actxprxy.dll file in...

  • RE: Putting results into strings...

    If you must use your original logic, rewrite as

    SELECT @WorkingString = isnull(@WorkingString + ', ', '') + CtrlCode

    FROM   (select top 100 percent ctrlcode from #tempcontrols ORDER...

  • RE: Putting results into strings...

    Why is LEN even considered? Here is a safer approach.

    -- Prepare test data

    DECLARE @Temp TABLE

            (

                CtrlCode VARCHAR(8)

            )

    INSERT @Temp

    SELECT 'TT4' UNION ALL

    SELECT 'T1' UNION ALL

    SELECT...

Viewing 15 posts - 2,041 through 2,055 (of 2,171 total)