Forum Replies Created

Viewing 15 posts - 16 through 30 (of 113 total)

  • RE: convert data type

    pls check below code:

    declare @t1 table(id int,name varchar(10))

    insert into @t1(id,name) values(1,'1'),(2,'2'),(3,'4'),(4,'7'),(5,'8_'),(9,'9'),(10,'0')

    select id,CONVERT(int,replace(name,'_','')) from @t1

    --CONVERT(int,replace(name,'_','')) from @t1

    where name like '%[^0_9]%'

    here name will come between 0 and 9 (zero,nine...

  • RE: Left Join doesn't return all recodrs in left table

    please check below codes.....

    declare @t1 table(id int,name varchar(10))

    insert into @t1(id,name) values(1,'A'),(2,'B'),(3,'C'),(4,'D'),(5,'E'),(6,'F'),(7,'G'),(8,'H'),(9,'I'),(10,'J')

    declare @t2 table(id int,name varchar(10))

    insert into @t2(id,name) values(1,'A'),(2,'B'),(3,'C'),(6,'F'),(8,'H')

    ----------------------LEFT JOIN------------------

    select T1.ID, T1.Name

    from @t1 t1

    left outer join @t2 t2 on t1.id=t2.id

    -------------------RIGHT JOIN...

  • RE: Export top(n) rows from Excel

    if you will use ssis

    pls follow given steps.

    (1)create excle connection..

    (2) go to excel sourse after that Data acess mode:sql commane

    ...

  • RE: SQL Search Query

    pls try below code

    select * from table where right(ltrim(rtrim(name,3)))='red'

    or left(ltrim(rtrim(name,3)))='red'

  • RE: Avoiding IF/ELSE

    PLS TRY BELOW CODE

    CREATE TABLE #Companies (CompanyID int)

    INSERT INTO #Companies (CompanyID) VALUES (1)

    INSERT INTO #Companies (CompanyID) VALUES (2)

    INSERT INTO #Companies (CompanyID) VALUES (3)

    CREATE TABLE #CompanyGroups (CompanyGroupID char(1), CompanyID int)

    INSERT INTO...

  • RE: WHERE condition..

    pls apply ltrim(rtrim()) function where class columns.....

  • RE: SSIS package errror

    this error is version related problem....

    pls try below steps...

    (1) open your SSIS Package related solution explorer

    next go to properties

    next go to dedugging

    next chage below mentioned property.

    RUN...

  • RE: How to Save Resultent Set into Anoher table

    if already table structure in there in database you fellow below logic..

    INSERT INTO table2 (Col1, Col2, Col3)

    SELECT Col1, Col2, Col3 FROM table1

    if table is not there in data that fimt

    follw...

  • RE: Using Checkpoint Files

    for excel one data flow under that 2 oledb sourse is there.

    one for to load data from 12 server to 60 server

    second one load dada from 13 server to...

  • RE: simple update statement

    pls provide ddl data based on that data i will provide query...

  • RE: derived column

    PLS try below code....

    SUBSTRING([Column 0],FINDSTRING([Column 0],"PAT",1),FINDSTRING(SUBSTRING(FINDSTRING([Column 0],"PAT",1),LEN([Column 0])),"~",1))

  • RE: char(??) vs varchar(??)

    pls check below code...

    declare @var_chr char(50)='abc'

    declare @var_varchr varchar(50)='abc'

    select DATALENGTH(@var_chr) chr,DATALENGTH(@var_varchr) var

    O/P:chrvar

    503

  • RE: alter column

    Pls check where you created FK_EmployeeLocDtl_DepartmentMaster foreign key table that column data type,master table column data type are same oher wise it will not allow that operarion....

    pls follw below steps:

    create...

  • RE: Why won't this query return data?

    plc check below query...

    declare @a int=0

    declare @t table(id int)

    insert into @t(id) values(1),(2),(3)

    select @a=ID from @t

    select @a first

    /******************STMT*******************/

    set @a=0

    select @a=@a+ID from...

Viewing 15 posts - 16 through 30 (of 113 total)