Click here to Skip to main content
15,910,471 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAdd to cart functionality Pin
Ravi_2123-Mar-08 20:21
Ravi_2123-Mar-08 20:21 
GeneralHome Work , Urgent question. Please ignore Pin
N a v a n e e t h23-Mar-08 20:32
N a v a n e e t h23-Mar-08 20:32 
GeneralRe: Add to cart functionality Pin
Christian Graus23-Mar-08 20:35
protectorChristian Graus23-Mar-08 20:35 
QuestionHow to pass parameters into sql jobs? Pin
ashish bhakhar23-Mar-08 19:19
ashish bhakhar23-Mar-08 19:19 
GeneralRe: How to pass parameters into sql jobs? Pin
Christian Graus23-Mar-08 20:36
protectorChristian Graus23-Mar-08 20:36 
GeneralRe: How to pass parameters into sql jobs? Pin
ashish bhakhar23-Mar-08 20:44
ashish bhakhar23-Mar-08 20:44 
GeneralRe: How to pass parameters into sql jobs? Pin
Christian Graus23-Mar-08 21:19
protectorChristian Graus23-Mar-08 21:19 
GeneralRe: How to pass parameters into sql jobs? Pin
ashish bhakhar23-Mar-08 23:22
ashish bhakhar23-Mar-08 23:22 
nothing find from google.
that's why i put my question here.
i have more expectations from codeproject than google.

This is my sql job:

USE [master]
GO
declare @file as varchar(500)
declare @dbName as varchar(50)
declare @LogicalName as varchar(50)
declare @ToServer as varchar(50)
exec('ALTER DATABASE ['+@dbName+'] SET SINGLE_USER WITH ROLLBACK IMMEDIATE')
exec('RESTORE DATABASE ['+@dbName+'] FROM DISK = N''F:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\'+@file+''' WITH FILE = 1, MOVE N'''+@LogicalName+''' TO N''F:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\'+@dbName+'.mdf'', MOVE N'''+@LogicalName+'_log'' TO N''F:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\'+@dbName+'_log.ldf'', NOUNLOAD, REPLACE, STATS = 10')
GO


I want to pass above four parameters like @file,@dbName,@LogicalName,@ToServer from my stored procedure to above job.

so, what i have to do for this?


this is my stored procedure:


ALTER PROCEDURE runjob
AS
Declare @backupfile varchar(500),@databasename varchar(50),
@logicaldatabasename varchar(50), @toservername varchar(50)
set @backupfile = 'test1.bak';
set @databasename = 'test1';
set @logicaldatabasename = 'test1';
set @toservername = 'Live';
BEGIN
--exec sp_who2
EXEC msdb.dbo.sp_add_job
@job_name = 'k',
@file = @backupfile,
@dbName = @databasename,
@LogicalName = @logicaldatabasename,
@ToServer = @toservername
EXEC msdb.dbo.sp_start_job k
END


so, what i have to do for this? and i m receiving an error
@file is not a parameter for procedure sp_add_job.
GeneralRe: How to pass parameters into sql jobs? Pin
saini arun24-Mar-08 5:39
saini arun24-Mar-08 5:39 
GeneralRe: How to pass parameters into sql jobs? Pin
Christian Graus24-Mar-08 9:59
protectorChristian Graus24-Mar-08 9:59 
Questionorder by clause in crystal reports Pin
Pankaj Garg23-Mar-08 19:15
Pankaj Garg23-Mar-08 19:15 
GeneralRe: order by clause in crystal reports Pin
Pankaj Garg23-Mar-08 22:59
Pankaj Garg23-Mar-08 22:59 
QuestionHow to avoid page refresh on click of F5 Pin
Prateek G23-Mar-08 18:54
Prateek G23-Mar-08 18:54 
AnswerRe: How to avoid page refresh on click of F5 Pin
Christian Graus23-Mar-08 20:36
protectorChristian Graus23-Mar-08 20:36 
GeneralCollectionBase trouble... Pin
Kasic Slobodan23-Mar-08 16:13
Kasic Slobodan23-Mar-08 16:13 
GeneralRe: CollectionBase trouble... Pin
N a v a n e e t h23-Mar-08 19:06
N a v a n e e t h23-Mar-08 19:06 
GeneralRe: CollectionBase trouble... Pin
Kasic Slobodan24-Mar-08 7:53
Kasic Slobodan24-Mar-08 7:53 
GeneralSupporting Unicode in SQL DB Pin
Mohammad A Gdeisat23-Mar-08 15:11
Mohammad A Gdeisat23-Mar-08 15:11 
GeneralRe: Supporting Unicode in SQL DB Pin
Christian Graus23-Mar-08 15:17
protectorChristian Graus23-Mar-08 15:17 
GeneralRe: Supporting Unicode in SQL DB Pin
Mohammad A Gdeisat23-Mar-08 15:21
Mohammad A Gdeisat23-Mar-08 15:21 
GeneralRe: Supporting Unicode in SQL DB Pin
Christian Graus23-Mar-08 16:00
protectorChristian Graus23-Mar-08 16:00 
GeneralRe: Supporting Unicode in SQL DB Pin
Mohammad A Gdeisat23-Mar-08 16:14
Mohammad A Gdeisat23-Mar-08 16:14 
GeneralSendin email through asp.net Pin
w20923-Mar-08 8:42
w20923-Mar-08 8:42 
GeneralRe: Sendin email through asp.net Pin
N a v a n e e t h23-Mar-08 8:44
N a v a n e e t h23-Mar-08 8:44 
GeneralRe: Sendin email through asp.net Pin
pmarfleet23-Mar-08 9:05
pmarfleet23-Mar-08 9:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.