Viewing 15 posts - 31 through 45 (of 233 total)
you need to modify your code like below.
IF EXISTS(SELECT 1 FROM master.dbo.sysobjects Where name='sc_CRDB' and Type='P')
DROP PROCEDURE sc_CRDB
GO
CREATE PROCEDURE sc_CRDB
AS
IF EXISTS(SELECT 1 FROM master.dbo.sysdatabases where name='MNCPCORP')
DROP DATABASE MNCPCORP
--GO
CREATE DATABASE MNCPCORP
ON...
-Vikas Bindra
December 21, 2009 at 2:11 am
Another way:
;WITH cte AS
(
SELECT ID
,dense_rank() over ( partition by ID order by ID,) AS R
FROM MyTable
)
SELECT ID
FROM cte
WHERE R > 1
GROUP BY ID
-Vikas Bindra
December 4, 2009 at 1:39 am
Go with Lynn. Mine is wrong in your scenario.
It converts Second in integer value to HH:MM:SS format
-Vikas Bindra
December 3, 2009 at 7:42 am
Try this:
SELECT DISTINCT j.name
,AVG(h.run_duration)
,substring(convert(varchar(25),(dateadd(ss
,AVG(h.run_duration)
,convert(datetime,convert(varchar(10),getdate(),121))
)
),121)
,11,9) As AvgDuration
FROM sysjobs j
INNER JOIN sysjobhistory h ON h.job_id=j.job_id
INNER JOIN
(SELECT job_id, MAX(STR(run_date,8)+ STR(run_time,8)) as LastRunDate
FROM sysjobhistory GROUP BY job_id) x
ON j.job_id=x.job_id
GROUP BY j.name
ORDER BY j.name
-Vikas Bindra
December 3, 2009 at 7:35 am
Rem-487422 (12/1/2009)
Hi Vikas,Did you bring all the original names of your packages?
I will keep you posted.
Thanks
REm
Yes I did bring the original names back and it is working since then...
-Vikas Bindra
December 1, 2009 at 7:27 am
Steve,
I would also say that...Please don't stop.
I visit the site everyday...to read articles...to participate in forums...to read the discussions going on in different post....to participate in QotD. In all,...
-Vikas Bindra
November 30, 2009 at 3:39 am
Oops...my bad...I didn't notice that...I also now think it is 2000..
You can write a blog on configuring DBMail 🙂 Again a small but helpful article.
-Vikas Bindra
November 26, 2009 at 6:30 am
Bru Medishetty (11/26/2009)
Not sure, whether the OP was using SQL 2000 or 2005 ?
Yes..He has not mentioned...
My reply stands for 2005 and 2008;-)
Hey Bru, I checked you site...you have small...
-Vikas Bindra
November 26, 2009 at 6:22 am
sp_send_dbmail must be present in MSDB under system Stored procedures.
To use this procedure to send mails first you need to configure Database Mail under the Management tab in SSMS.
-Vikas Bindra
November 26, 2009 at 12:19 am
You can use a for each loop in SSIS to load all the files in the folder.
Search on BOL for details on Foreach loop.
-Vikas Bindra
November 25, 2009 at 8:26 am
Lets wait for his reply.:Whistling:
-Vikas Bindra
November 25, 2009 at 8:07 am
Bru Medishetty (11/25/2009)
vikas bindra (11/25/2009)
EXEC msdb.dbo.sp_send_dbmail@profile_name = 'ProfName',
@recipients = '',
@query = 'SELECT 1,1,1,1,1',---specify your select...
-Vikas Bindra
November 25, 2009 at 8:01 am
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'ProfName',
@recipients = '',
@query = 'SELECT 1,1,1,1,1',---specify your select query here
...
-Vikas Bindra
November 25, 2009 at 7:42 am
There is no END IF in t-SQL.
use
IF
BEGIN
END
ELSE
BEGIN
END
-Vikas Bindra
November 23, 2009 at 6:47 am
Nabha (11/23/2009)
Jeff Moden (11/20/2009)
Nabha (11/20/2009)
MY bad! go with Vikas, that is the right solution for you.
Heh... no it's not...that function has a While Loop in it and it's going to...
-Vikas Bindra
November 23, 2009 at 1:28 am
Viewing 15 posts - 31 through 45 (of 233 total)