Forum Replies Created

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

  • RE: Select + variables from table by batch script

    
    
    set @cmd = "SELECT @aom_rate = gccy.HCR_BMIDDLE, @aom_ccy_cts = gccy.HCR_CCY_CTS FROM [" + @current_user + "].[AO_InqCst_TEMPCCY] AS gccy WHERE gccy.HCR_CODE = '" + @aom_ccy +...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Bulk Insert

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

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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]...

    Far away is close at hand in the images of elsewhere.
    Anon.

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