Forum Replies Created

Viewing 15 posts - 1,831 through 1,845 (of 3,543 total)

  • RE: Produce a list of users and whose houses they rent

    Damn, Ryan beat me to it, agian

    My solution anyway

    CREATE FUNCTION dbo.udf_renters (@house int)

    RETURNS varchar(1000)

    AS...

  • RE: Stored Procedure

    I am not sure of your requirements, please supply sample input and desired output.

  • RE: Grouping Records

    Or you could utilize a function

    CREATE  FUNCTION dbo.udf_warehouse (@SKU int, @status varchar(4), @Date datetime)

    RETURNS varchar(100)

    AS

    BEGIN

        DECLARE @result varchar(100)

        SELECT @result = COALESCE(@result+',','') + Warehouse

        FROM Items

       ...

  • RE: recursive query

    CREATE FUNCTION dbo.GetReports(@IncludeParent bit, @intParentPlantAreaID int)

    RETURNS @retFindReports TABLE (intParentPlantAreaID int, strPlantAreaName varchar(50), intPlantAreaID int)

    AS 

    BEGIN

    DECLARE @child TABLE (intParentPlantAreaID int, strPlantAreaName varchar(50), intPlantAreaID int)

    DECLARE @parent TABLE (intParentPlantAreaID int, strPlantAreaName...

  • RE: Simple SQL Query

    Nice one Jason.

    I should of thought of that

  • RE: Simple SQL Query

    Try

    EXEC sp_executesql @sqlcmd, N'@JobID INT OUTPUT', @JobID OUTPUT

  • RE: Query Execution Plan

    What version of SQL are you using?

    On SQL2k I get the following plan

    Filter(WHERE[calllist].[DispoType]='984'))

      |--Bookmark Lookup(BOOKMARK[Bmk1000]), OBJECT

  • RE: select date closest to today

    This gave an error when I tried it

    My solution

    SELECT TOP 1 Hid, HDate

    FROM

    ORDER BY ABS(DATEDIFF(day,HDate,GETDATE())) ASC

    This will ignore time...

  • RE: Running a Stored Procedure from a Batch File

    or if you do not wish to use an input file then

    osql -Q "EXEC SP_FormatName 'TEST_TABLE'" /U sql_username /P sql_password /S servername /o logfilename

  • RE: objects with same id returned in one row

    If the table is fixed as specified then either of these

    SELECT call_id,

    1 AS [event_1],

    MAX(CASE WHEN event=1 THEN param1 ELSE null END) AS [param1_1],

    MAX(CASE WHEN event=1 THEN param2 ELSE...

  • RE: Hiring A DBA

    quoteI did not mean to offend people.

    No offence here

  • RE: select question

    SELECT manufacturerid, MIN(itemid) AS [itemid]

    FROM [Prod]

    GROUP BY manufacturerid

    ORDER BY manufacturerid

  • RE: Bulk insert fails when we use a format file

    Not sure how that got there I think BCP did it when I experimented with creating output fmt files

    After experimenting further I found...

  • quoteYou spent 10 years with a company, first of all, all you had was the experience in that...
  • RE: Bulk insert fails when we use a format file

    Not sure about the error but because your file is character you cannot use SQLINT for field definitions although BCP will output this in a fmt file by default.

    Try this...

Viewing 15 posts - 1,831 through 1,845 (of 3,543 total)