Viewing 14 posts - 16 through 29 (of 29 total)
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...
September 22, 2011 at 3:13 am
Hi,
Try the following syntax:-
select convert(varchar(12),getdate(),101)
Result:-
9/19/2007
regards
Palash Gorai
September 22, 2011 at 1:43 am
Okay,
Try this one..
CREATE TYPE dbo.DynamicTbl AS TABLE
(
@TransID int,
@TableName varchar(50)
)
For Dynamic Columns, let me check....
Regards
Palash Gorai
September 19, 2011 at 5:37 am
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...
September 19, 2011 at 4:58 am
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)...
September 15, 2011 at 3:58 am
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...
September 14, 2011 at 3:29 am
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 =...
September 13, 2011 at 4:03 am
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,...
September 13, 2011 at 3:50 am
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...
September 13, 2011 at 12:15 am
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
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
September 12, 2011 at 5:58 am
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...
September 12, 2011 at 4:42 am
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...
January 5, 2011 at 1:48 am
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...
January 5, 2011 at 1:41 am
Viewing 14 posts - 16 through 29 (of 29 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy