Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)

  • RE: 4-table join not returning all the data I need

    Try this

    SELECT C.AnswerText, COUNT(C.AnswerValue) AS 'Count'

    FROM dbo.SurveyResults AS R

    INNER JOIN dbo.SurveyQuestions AS Q

    ON R.QuestionID = Q.QuestionID

    INNER JOIN dbo.InstallCardCustomerInformation AS I

    ON R.InstallCardID =...

  • RE: Table Dependencies and a list of Stored Procedures

    This should help you list all the objects that are there in the database and their dependencies

    select so1.[name] as 'objectname', so1.[xtype] as 'type', so2.[name] as 'dependson'

    from sysdepends sd

    inner join sysobjects...

  • RE: Simple query i CANNOT figure out :(

    Assuming that testscores has an id column

    and you are looking for persons that have only f1, f2 and f3 and no p1, p2,p3

    How about:

    select *

    from testscores as ts1

    where alpha_score_1 like...

  • RE: looking up in the tree

    I have created a function that will return the best match for a given id. It will return the [id] from TempTableB based on the criteria you specified or...

  • RE: SQL Stored Procedure parameter in like statement

    Try this

    CREATE PROCEDURE usp_TestLike @VarName varchar(100)

    AS

    SET NOCOUNT ON

    SET @VarName = ISNULL(@VarName,'') + '%'

    SELECT *

    FROM sysobjects

    WHERE [name] LIKE @VarName

    GO

    This will work with the variable that start with this name if you...

  • RE: trim last character in a string for all records in a column

    Since you need all the of the string other than the last character, you can use LEFT.

    Here is how you can use it

    create table #tb_area

    (

    area varchar(50)

    )

    insert into #tb_area

    (area)

    select 'DOWNTOWNO' union...

Viewing 6 posts - 1 through 6 (of 6 total)