Viewing 15 posts - 76 through 90 (of 168 total)
I had once created a data log system which creates table triggers dynamically.
I have noted down my notes at SQL Server Log Tool for Capturing Data Changes by building Change...
July 5, 2010 at 4:43 am
Hi Ruyven,
Here is an other example on How to SQL Select from Stored Procedure using SQL Server OPENQUERY or OPENROWSET
I liked this method, but I believe it will be better...
July 5, 2010 at 4:30 am
Hi Raul,
Here is an other solution
with cte as (
select
State,
amt,
per,
rn = ROW_NUMBER() over (partition by state order by amt desc)
from summax
)
select
state,
SUM(amt) total,
per = (select cte2.per from cte cte2...
July 5, 2010 at 2:26 am
Hello,
That is what Gail suggested I guess
DECLARE @parent_id int
SET @parent_id = (
SELECT TOP 1 parent_id FROM sys.triggers WHERE object_id=@@PROCID
)
SELECT OBJECT_NAME(@parent_id)
July 5, 2010 at 1:40 am
Hi,
I think this is not an HTML formatted email.
Perhaps if you can set email format to HTML, you can control it better.
You can check SQL Server Database Mail sp_send_dbmail Example
You...
June 22, 2010 at 12:38 am
Hi pcgm,
My code responds to changes in model
If you want to respond to changes in value column please change the WHERE clause as follows
t1.value <> t2.value --t1.model <> t2.model
I mean
with...
June 21, 2010 at 11:46 pm
Here is my code suggestion :
with cte as (
select *, rn = ROW_NUMBER() OVER (Order By Id) from FindChanges
)
select t1.*, t2.*
from cte t1
full join cte t2 on t1.rn = t2.rn...
June 21, 2010 at 7:55 am
Hi all,
Are you sure that the previous solution works successfully?
I could not understand why we need to set the win32 in the WHERE clause of the CTE
I think Steve has...
June 21, 2010 at 7:27 am
Hi Suresh,
Can you please check the tutorial named How to SQL Select from Stored Procedure using SQL Server OPENQUERY or OPENROWSET
When I use a code like below
SELECT *
into #t
FROM...
June 14, 2010 at 7:31 am
That is the Process Id that indicates the processes SQL engine uses for completing tasks.
For example if you run a query it may be done by a single process than...
June 14, 2010 at 7:16 am
By the way, you can also test the below OPENXML code statement
DECLARE @h INT, @X XML
SELECT @X = c FROM OPENROWSET (BULK 'C:\Test.xml', SINGLE_BLOB) AS Temp(c)
EXEC sp_xml_preparedocument
June 10, 2010 at 7:00 am
Hi,
Please test the below t-sql code according to your settings
Select
C.value('.','varchar(100)') AS category
From @xml.nodes('/tv/programme/category') T(C)
Please note that I changed the category[1] to '.' and @X.nodes('/tv/programme') to @xml.nodes('/tv/programme/category')
I hope that helps,
June 10, 2010 at 6:58 am
You can sort data by ORDER BY clause.
So you can order Activity, OtherFields, then DateTimeField as
ORDER BY Activity, OtherFields, DateTimeField
But in SQL2005 there are new ranking functions like
ROW_NUMBER() OVER (PARTITION...
May 14, 2010 at 6:23 am
Hello,
You can try the following script
select 'alter table A drop column ' + name from sys.columns where object_id = object_id(N'Customer')
But this creates drop column command for each column, so...
May 12, 2010 at 8:36 am
Viewing 15 posts - 76 through 90 (of 168 total)