Forum Replies Created

Viewing 14 posts - 16 through 29 (of 29 total)

  • RE: Updation in tables

    Hi,

    You can do it by creating SProc.

    ALTER PROCEDURE UPDATE_INSERT

    AS

    BEGIN

    UPDATE EMP1

    SET EMP1.EMPANME = B.EMPANME, EMP1.EMPCODE = B.EMPCODE, EMP1.CITY = B.CITY

    FROM EMP1 A, EMP2 B

    WHERE A.EMPID = B.EMPID

    INSERT INTO EMP1

    SELECT * FROM...

  • RE: SSIS - type cast to MM/DD/YYYY from YYYYMMDD

    Hi,

    Try the following syntax:-

    select convert(varchar(12),getdate(),101)

    Result:-

    9/19/2007

    regards

    Palash Gorai

  • RE: Display Columns names and values Vertically

    Okay,

    Try this one..

    CREATE TYPE dbo.DynamicTbl AS TABLE

    (

    @TransID int,

    @TableName varchar(50)

    )

    For Dynamic Columns, let me check....

    Regards

    Palash Gorai

  • RE: Display Columns names and values Vertically

    Hi,

    This CREATE TYPE code will run on only SQL 2008

    First Create User Defined Table:-

    CREATE TYPE dbo.DynamicTbl AS TABLE

    (

    @TransID as int,

    @TableName as varchar(50)

    )

    Then Create Procedure or Function:-

    Create Procedure...

  • RE: sorting through duplicate data

    Another Way:-

    select a1.* from a as a1, a as a2

    where a1.master_id = a2.master_id

    and a1.subid = a2.subid

    and a2.subdid_price = (select min(subdid_price) from a)

    OR

    select b.* from a as b,

    (select master_id, min(subdid_price)...

  • RE: INSERT INTO

    Second Insert Statement will give 1 count as the Primary Key is there on CID. At the time of insertion, It will only insert the first record, for second and...

  • RE: 'create one row from two rows query'

    Slighty change in my code:-

    select distinct a.dbpatcnt, a.dbpatfirstname, a.dbpatlastname,

    a.dbphonenumber, dbphonenumber1

    from

    (select dbpatcnt, dbpatfirstname, dbpatlastname,

    dbphonetypeid, dbphonenumber

    from dbo.patient P

    inner join dbo.LnkPhone L

    on dbpatcnt = dbkeycnt

    inner join dbo.phone Ph

    on l.dbphoneid = ph.dbphoneid

    and dbphonetypeid =...

  • RE: 'create one row from two rows query'

    Hi,

    Another way:-

    select distinct a.dbpatcnt, a.dbpatfirstname, a.dbpatlastname,

    a.dbphonenumber, dbphonenumber1

    from

    (select dbpatcnt, dbpatfirstname, dbpatlastname,

    dbphonetypeid, dbphonenumber

    from dbo.patient P

    inner join dbo.LnkPhone L

    on dbpatcnt = dbkeycnt

    inner join dbo.phone Ph

    on l.dbphoneid = ph.dbphoneid) as A,

    (select dbpatcnt, dbpatfirstname, dbpatlastname,

    dbphonetypeid,...

  • RE: Almost real time data for reporting database.

    Hi,

    As the size of each DB is huge and 350 DB's are there, then OLAP will definitely take time to load and it won't be a Real Time. ETL will...

  • RE: help required plz

    Hi,

    Another way (Note:- When you are sure that First , Middle and Last Name are mentioned in order)

    DECLARE @STRING1 NVARCHAR(100)

    DECLARE @STRING2 NVARCHAR(100)

    DECLARE @STRING3 NVARCHAR(100)

    DECLARE @F INT

    DECLARE @m INT

    SET...

  • RE: Combine data of 3 tables into a single row

    Hi Zaleeu,

    I have used the same example as mentioned in this forum and ran at my end. Following is the result

    NAME123

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    PaulNULLOrangesNULL

    PeterApplesNULLPlums

    (2row(s)affected)

    Can you share your code?

    Thanks

    PG

  • RE: Combine data of 3 tables into a single row

    Hi,

    This is another way...

    SELECT DISTINCT NAME,I.FRUITID, FRUIT

    INTO #TEMP1

    FROM FruitDistibutors F

    INNER JOIN Interlink I

    ON F.DistributorID = I.DistributorID

    INNER JOIN FruitNames N

    ON FRUITID = ID

    SELECT * FROM #TEMP1

    pivot (

    MAX (FRUIT) for FRUITID

    IN...

  • RE: SQL Server 2005 Express: Cannot connect to Server Name

    Hi,

    Prior to connect the SQL Server, go to SQL Server Configuration Manager, Click on Protocols for MSSQLServer and Enabled TCP/IP and put port whichever you want. by Default it is...

  • RE: Reporting Services Login dialog box

    Hi All,

    I was also facing the same issue and the last option was to format the system. But i did a little bit RCA and found that due to Antivirus...

Viewing 14 posts - 16 through 29 (of 29 total)