Forum Replies Created

Viewing 15 posts - 2,011 through 2,025 (of 3,543 total)

  • RE: Question of the Day for 16 Jan 2006

    Can someone clarify the supposed correct answer

    Server.SetDefaultInitFields has one parameter, allFields, and is a boolean and therefore cannot be set to 'list of fields you need returned'

    if set to False 'objects...

  • RE: Translate this in a stored procedure

    A possible alternative

    DECLARE @chars varchar(255), @code varchar(6)

    SET @chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'

    SET @code = ''

    SELECT @code = @code + [char]

    FROM

    (SELECT TOP 6 SUBSTRING(@chars,number,1) AS [char]

    FROM master.dbo.spt_values WHERE type = 'P' AND number...

  • RE: Dynamic Insert

    You could try with dynamic sql, first run this (change the name of the excel file)

    SELECT *

    INTO #temp

    FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;HDR=YES;Database=C:\temp\book1.xls', [sheet1$])

    SELECT colid,[name]

    FROM tempdb.dbo.syscolumns

    WHERE [id] = OBJECT_ID('tempdb.dbo.#temp')

    AND [name]...

  • RE: Loop or Cursor needed? Questions on SQL Query...

    Do as Vladan suggests (he always seems to get the best ideas )

    or select the guids into a temp table and

    select...

  • RE: How to encorporate IF

    Unless it it the sum of unique rmstranamt's that is required

  • RE: How to return more than one column with the READTEXT HELP!!!

    To display an image to the client

    Get the data into a byte array as per Eriks example, e.g. Buffer

    Then put the data in a PictureBox

    Dim ms AS MemoryStream = new...

  • RE: How to encorporate IF

    SELECT RMSFILENUM, SUM(rmstranamt) AS [rmstranamt10]

    FROM (SELECT RMSFILENUM, rmstranamt AS rmstranamt10

    FROM RFINANL

    WHERE RMSTRANCDE = '10'

    GROUP BY RMSFILENUM, rmstranamt) x

    GROUP BY RMSFILENUM

  • RE: Loop or Cursor needed? Questions on SQL Query...

    CREATE TABLE #temp (userid int)

    INSERT INTO #temp (userid) SELECT userid from [users]

    DECLARE @maxq int, @qid int,@sql nvarchar(4000)

    SELECT @maxq = MAX(questionid) FROM [questions]

    SET @qid = 1

    WHILE @qid <= @maxq

    BEGIN

    SET @sql =...

  • RE: Normalization question...

    If you enforce the non duplication then I see no problem with that method, i.e.

    E1   E2   x     y     z

    --   --   ---   ---   ---

    1    5    0.1   0.2   0.3

    or

    E1   E2   x     y    ...

  • RE: Normalization question...

    Agree with Chris

    If your data was in two tables then the joining table would not be an issue the only peculiarity is that the joining (interaction) table references one table instead...

  • RE: varchar size overflow

    You could try this, but probably not the best solution (make sure the input ends with a comma !!!)

    CREATE PROC usp_GetColumnName @ptr varbinary(16), @start int, @length int

    as

    READTEXT #temp.search_clause...

  • RE: First Poll for 2006

    It's hard to soar like an Eagle when you work with Turkeys

    and... not really a saying but....

    Far away is close at hand in the images of elsewhere

    Anon.

  • RE: Join On Null??

    use LEFT OUTER JOIN for any column that maybe null and check for null when ouput (as per p.firstName etc)

  • RE: SELECT DISTINCT

    Not possible as the 'unique column' will prevent distinction

    You will either have to

    ignore the 'unique column' e.g.

    SELECT col1,col2,col3 FROM GROUP BY col1,col2,col3

    or aggregate the 'unique column' e.g.

    SELECT col1,col2,col3,MIN([unique column])...

  • RE: Select & Sort - Stumped

    SELECT Employee, [DateTime], Status

    FROM @table a

    WHERE NOT EXISTS(SELECT * FROM @table b

    WHERE b.Employee = a.Employee

    AND b.[DateTime] = a.[DateTime]-1

    AND b.Status = a.Status)

    ORDER BY Employee, [DateTime]...

Viewing 15 posts - 2,011 through 2,025 (of 3,543 total)