Viewing 15 posts - 1 through 15 (of 27 total)
Try it
Create Function dbo.Fun_Proc_Test1(@id1 int) Returns varchar(30)
As
Begin
Declare @res varchar(30)
--Set @res = (Select * From OpenQuery(ABHI, N'Declare @result varchar(30) Exec Abhi.Test.dbo.convert2Lower @id = ' + Cast(@id1 As Varchar(5)) + ''', ...
May 17, 2012 at 3:32 am
Cast/Convert the output. Try
Declare @i int = 10
Select Cast(@i as varchar(10))
May 14, 2012 at 4:40 am
Merge should help u...
MERGE INTO TABLE_NAME USING table_reference ON (condition)
WHEN MATCHED THEN
UPDATE SET column1 = value1 [, column2 = value2 ...]
WHEN...
May 13, 2012 at 10:48 pm
Its continuation to my previous reply 🙂
May 11, 2012 at 3:16 am
Small change in update
--and the twist here is i need to update these 2 rows (1 and 4) with let's say RecordToCall = 1
Update
App
Set
App.RecordToCall = 1
From
Appointments App,
(
Select
RecNum,
RANK() Over...
May 10, 2012 at 10:58 pm
check it...
Set NoCount On
Create table Appointments (
RecNum int,
Patient_ID int,
Patient_FirstName varchar(25),
Emp_ID int,
Emp_FirstName varchar(25),
App_Datetime datetime,
RecordToCall bit )
Insert into Appointments (RecNum, Patient_ID, Patient_FirstName, Emp_ID, Emp_FirstName, App_Datetime) Values
(1, 1234, 'John', 9876, 'Adam', '5/12/2012 9:00...
May 10, 2012 at 10:48 pm
Otherwise, use ModifiedBy Column in the parent table and refer it in the trigger.
May 10, 2012 at 4:08 am
Let us know the expected o/p
May 9, 2012 at 12:44 am
Check the read and write %age on the tables. If the table is queried ones in a year, then there is no pointing in having indexes for such tables. Bank...
April 19, 2012 at 9:02 pm
Try this
Select
dq_src_id
dq_org_dist_id,
dq_rec_seq_nbr,
dq_status_cd,
dq_prev_status_cd,
dq_curr_status,
dq_rec_eff_dt,
dq_rec_upd_user,
rank() over (partition by dq_org_dist_id Order By dq_src_id Desc) as Rank
From
tmp_dist
Order By
dq_org_dist_id
April 18, 2012 at 5:44 am
Try it...
Set ANSI_NULLS ON
Set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AppInsert] (
@User int
,@ID int
,@price money )
AS
Begin
IF EXISTS (SELECT Null FROM dbo.PriceTest WHERE User = @User AND ID = @ID)
UPDATE dbo.PriceTest SET Price...
April 16, 2012 at 10:51 pm
Try this
Create Table #tmpExecution (Id int Identity, dtStart Datetime, dtEnd Datetime)
Declare @dtStart DateTime, @dtEnd DateTime
While (1=1)
Begin
Select @dtStart = GETDATE()
Execute 'Stored Procedure'
Select @dtEnd = GETDATE()
Insert into #tmpExecution (dtStart, dtEnd) Values (@dtStart,...
April 10, 2012 at 10:18 pm
Viewing 15 posts - 1 through 15 (of 27 total)