Forum Replies Created

Viewing 15 posts - 136 through 150 (of 761 total)

  • RE: Finding a quote in a string

    dwain.c (12/19/2012)


    Since quote is also CHAR(25), you can also do this:

    CHARINDEX(CHAR(25), string_column) > 0

    Single Quote is char(39) Dwain......if I am not wrong. 😉

  • RE: How to determine which items in one table do not appear in a second table

    Here is another way of doing it:

    Select a.ItemID, b.ActionID From

    (

    Select Distinct ItemID From Items

    ) As a

    CROSS JOIN Actions As b

    Except

    Select ItemID, ActionID From Items

  • RE: help!!! calculate average rolling 4 last weeks

    Here is another way using Correlated SubQuery:

    Create Table Ex1

    (

    YEAR int,

    WEEKS int,

    VALUE int

    )

    Insert Into Ex1

    Select 2012, 1,3000

    Union ALL

    Select 2012, 2,5000

    Union ALL

    Select 2012, 3,6000

    Union...

  • RE: combine stored procedures result

    If the columns are dynamic then on what persistent basis do you plan to JOIN the columns??.....or is it that it does not matter??......Just by looking at your explanation it...

  • RE: Hi frn

    dwain.c (12/17/2012)


    Not very elegant but you might be able to use something like this, assuming your intent is to sort numbers first as numbers followed by non-numeric characters:

    CREATE TABLE #varchar_field1...

  • RE: eliminate one digit from the record

    Welcome to SQL Server Central busappa.

    Following should do what you want :

    Declare @string Varchar(10)

    Set @string = 'Vinu'

    Select STUFF(@String, LEN(@String), 1, '')

    If this is not what...

  • RE: Table variables

    Eeezy Peezy!! :-P:-D

  • RE: single quote in sql statement

    If the no. of quotes are still confusing for you in the solution provided by Lynn......then you can also use the CHAR() function in sql server to apply quotes by...

  • RE: Simular to PIVOT Table, but not

    If I am not too late....here is the dynamic version :

    Declare @sql Nvarchar(MAX)

    ;With CTE

    As

    (

    Select Distinct LabName From #LabValues

    )

    Select @sql = STUFF((Select ',MAX(Case When LabName...

  • RE: How to query odd record

    shel (11/28/2012)


    col1col2date time

    brecord set1/1/12 4:10

    brecord clear1/1/12 3:12

    brecord set1/2/12 13:12

    I don't think the sample data you provided is consistent. You can see above that the date time for the 'record...

  • RE: Search String in Entire Database

    Try implementing the following procedure :

    Create Procedure PR_SearchDatabase

    @field NVarchar(400),

    @input NVarchar(400)

    As

    Begin

    Declare @tablename NVarchar(400), @sql NVarchar(Max)

    Declare @table Table(Data NVarchar(max))

    Declare TableName_Cursor Cursor LOCAL STATIC Forward_Only...

  • RE: how to avoid duplictae records of column in a table in a select query in this proc?

    sivajii (11/15/2012)


    hi

    vinu512

    thanks for the solution which u just posted for me

    You're Welcome. Glad it was halpfull for you.

  • RE: SQL AGENT JOB - Manually runnable only

    This is the process to remove the job from the schedule :

    1. Open Tree View in Object Explorer in SSMS.

    2. Open SQL Server Agent.

    3. Open Jobs under SQL Server...

  • RE: Debugging a loooong query

    Since, its a conversion error.....I would look at the error to know the datatypes in the error message. Then I would look at comparisons(equal to, greater than, lesser than etc.)...

  • RE: Need help with the below procedure

    As you can guess from the error....one of your queries is returning more than a single value. But I won't be able to help you much just by looking at...

Viewing 15 posts - 136 through 150 (of 761 total)