Forum Replies Created

Viewing 15 posts - 3,211 through 3,225 (of 3,543 total)

  • RE: Dynamic Sql

    
    
    DECLARE @ok char(1)
    SET @ok = 'N'
    SET @cprice_sql = 'select @ok=''Y'' from v_loan_and_loan_shipped where loan_id = '+ @LNID + ' and (' + @psyntax + ') '
    exec...
  • RE: Outer Join with Single Row Result

    Additional. If your are producing a proc and don't mind using a temp table then this a possible solution.

    
    

    create table TABLEA ([ID] int)
    create table TABLEB...
  • RE: Outer Join with Single Row Result

    Is there any data on the child records that identifies it's position within the parent? eg

    TABLEA

    IDA

    1

    2

    3

    TABLEA

    IDA,IDB

    1,1

    1,2

    2,1

    2,2

    2,3

    3,1

    Can u post structure of both tables, test data and expected result?

    Edited by - davidburrows...

  • RE: Query Output

    I have a weekly scheduled job that has 3 steps using procs to update a database. 3 more steps, each using isql to extract data from the tables updated to...

  • RE: Code to Format Numeric Data?

    Samples

    DECLARE @val money
    
    SET @val = 1234567.89
    SELECT CONVERT(char(15),@val,1)


    DECLARE @val int
    SET @val = 1234567
    SELECT LEFT(CONVERT(char(18),CAST(@val AS money),1),15)


    DECLARE @val decimal(9,2)
    SET @val = 1234567.89
    SELECT CONVERT(char(15),CAST(@val AS money),1)


    DECLARE @val real
    SET...
  • RE: Need Help with Cross-Tab

     SELECT AptDate, AptTime,
    
    MAX(CASE WHEN SchedName = 'Monica' THEN Appt ELSE '' END) AS Monica,
    MAX(CASE WHEN SchedName = 'Olivia' THEN Appt ELSE '' END) AS Olivia,
    MAX(CASE...
  • RE: record formating

    Or

    select col1,

    col2,

    max(col3),

    max(col4),

    max(col5),

    max(col6)

    from tablename

    group by col1,col2

    to group by first 2 cols.

    Edited by - davidburrows on 06/26/2003 06:44:56 AM

  • RE: Transferring Logins to a new server

    Before I transfer/copy/restore any database to another server I always use the following to generate sql to create login(s). This makes sure that the sid is the same so that...

  • RE: Bulk Insert

    racosta,

    Thats ok if you are supplying the value of the identity column. If not and you want sql to generate the value then you need to use a format file.

    BTW...

  • RE: Bulk Insert

    Create a format (.fmt) file and pass it to the bcp command.

  • RE: Updating text column

    Yes but you will have to update the text column one row at a time and once for each source data using a pointer for the source text and a...

  • RE: Help Syntax error converting the varchar value

    DECLARE @na varchar(100)

    set @na ='1,2,3,4,5'

    DELETE FROM [Gibor_h].[dbo].[Sn]

    WHERE charindex(','+CONVERT(varchar,[na])+',',','+@na+',') > 0

    Sorry in my last post forgot to put commas around converted na column. Need to do this to make sure...

  • RE: IN dynamic string problem..

    You could try

    select *

    from master..FGMapperPageAlloc

    where dbid = 6 and fileid = 1

    and charindex(ObjectNameAtPage,@vmyobj_) > 0

    order by 1,2

    Sorry, typo.

    Edited by - davidburrows on 06/24/2003 07:41:11 AM

  • RE: Help Syntax error converting the varchar value

    Also you are trying to misuse EXEC. Is this what you are trying to do?

    DECLARE @na varchar(100), @sisi int, @mmh char(10)

    set @na ='1,2,3,4,5'

    set @sisi='2'

    SET @mmh='555'

    UPDATE [Gibor_h].[dbo].[Sn]

    SET [sisi] = @sisi,

    [mmh]...

  • RE: Using "Like" or Wildcard

    Wanda,

    Seems to me your code looks OK and matches your requirements. Maybe the problem is to do with data.

    Try

    SELECT LEDef_ActiveInd, LEDef_Cd FROM LEDef_PK WHERE LEDef_ActiveInd = 1

    Do you get all...

Viewing 15 posts - 3,211 through 3,225 (of 3,543 total)