Viewing 15 posts - 46 through 60 (of 74 total)
Hi,
I'm not sure exactly how the query is executed. Some simple queries might be run on the remote server and only the answer is returned. But rather quick you will...
March 10, 2010 at 4:51 am
Does this give you the result you want?
declare @t table (Item_no int , stock1 int,stock2 int ,date datetime )
insert into @t
select 0001 ,5 ,5 ,'2010-01-01' union select...
March 10, 2010 at 3:32 am
I did solve it using FOR XML EXPLICIT, but I'm not sure it's the best option here. The problem with EXPLICIT is that you need to know how many levels...
March 10, 2010 at 3:23 am
Hi Bob,
It's not clear what you want. If you want no of orders placed on a particular date, you would need to either add the date in the select clause...
March 10, 2010 at 2:33 am
Hi Chris,
perhaps you can do something like this:
declare @StoreRows table (caseid int)
-- Make a list of all rows inserted
insert into @StoreRows
select caseid -- or what key column you have
from inserted
if...
March 8, 2010 at 7:46 am
Hi Chris,
It's not a good idea to "accept the insert" and not store all the rows inserted. Better to either accept the insert with all rows or reject the whole...
March 5, 2010 at 5:55 am
You can't have one trigger for two tables, but you should be able to use two (sligtly different) triggers on the two tables.
Perhaps something like this:
create trigger myTableATrigger on TableA
for...
March 5, 2010 at 5:04 am
This is a start, can probably be done even more.
select
Case When not Isnull(val1,'N') = 'N' Then 1 -- previously issued an check
...
March 4, 2010 at 4:16 am
Hi,
you could use a Tally-table to solve the problem:
CREATE TABLE #TABLE_FROM
(
ID INT,
A1 VARCHAR(100),
A2 VARCHAR(100),
A3 VARCHAR(100),
A4 VARCHAR(100)
)
INSERT INTO #TABLE_FROM VALUES (1, '65656515', 'Male', 'Allan', 'Iverson');
INSERT INTO #TABLE_FROM VALUES...
March 4, 2010 at 3:00 am
Use a TRY ... CATCH block:
BEGIN TRY
EXEC Revnue.RevEmpAgg.[dbo].[usp_insertempcount] @empid,@jobrole,@startdate
EXEC msdb.dbo.sp_send_dbmail -- Send success mail
END TRY
BEGIN CATCH
EXEC msdb.dbo.sp_send_dbmail -- Send failure...
March 3, 2010 at 10:23 am
Imu, I didn't see your post until after I posted my solution..
From now on, I will look for a Tally-solution first, before trying with a loop (or cursor)... 😉
/Markus
March 3, 2010 at 1:49 am
Here is one way to solve the problem:
declare @STR varchar(200)
set @STR = 'Apple, Banana,Orange, Pinapple, Lemon'
declare @result table (string varchar(100))
declare @start int
declare @end int
set @start =...
March 2, 2010 at 8:44 am
You can, but you need to take care about nul-values (i.e. ASCII NUL = char(0).), because these seem to act as string terminator:
declare @bin varbinary(20)
-- Converting to and from binary
set...
March 2, 2010 at 4:56 am
Hi,
you have switched the columns in the insert statements, change to:
insert into tripD( tripH_trnxid, wday) values(@ID, '1011010')
insert into tripD( tripH_trnxid, wday) values(@ID , '1111110')
Then everything will work as expected.
/Markus
February 26, 2010 at 7:49 am
Hi Gail,
GilaMonster (2/20/2010)
Hunterwood (2/16/2010)
It´s allways a good rule of thumb to use TOP 1 together with EXISTS, because it prevents the database engine from doing unneccesary work.
Got an example that...
February 23, 2010 at 2:39 am
Viewing 15 posts - 46 through 60 (of 74 total)