Click here to Skip to main content
15,890,438 members
Home / Discussions / Database
   

Database

 
GeneralRe: Column lenth as read from syscolumns table Pin
Ashfield22-Apr-08 21:15
Ashfield22-Apr-08 21:15 
QuestionSQL HELP Pin
n1coltsfan21-Apr-08 5:38
n1coltsfan21-Apr-08 5:38 
GeneralRe: SQL HELP Pin
Michael Potter21-Apr-08 8:21
Michael Potter21-Apr-08 8:21 
GeneralRe: SQL HELP Pin
n1coltsfan21-Apr-08 8:36
n1coltsfan21-Apr-08 8:36 
GeneralRe: SQL HELP Pin
Michael Potter21-Apr-08 8:56
Michael Potter21-Apr-08 8:56 
GeneralRe: SQL HELP [modified] Pin
Blue_Boy21-Apr-08 9:17
Blue_Boy21-Apr-08 9:17 
GeneralRe: SQL HELP Pin
n1coltsfan22-Apr-08 8:44
n1coltsfan22-Apr-08 8:44 
QuestionHow to write the multiple query in single store procedure? [modified] Pin
bruze21-Apr-08 1:11
bruze21-Apr-08 1:11 
I have written the query(Update,View,Delete) in three Stored Procedure such as SP_GetOfficeHourToday,SP_UpdateOfficeOpenCloseHours,SP_DeleteOfficeHour

How to write the multiple query( View,Update,Delete) in single store procedure using SqlServer2005.

USE [Myrefer]

GO
/****** Object: Table [dbo].[Office_Hours] Script Date: 04/21/2008 17:06:05 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Office_Hours](
[DayOfTheWeek] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OfficeOpenHours] [char](4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OfficeCloseHours] [char](4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF




VIEW
*******
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[SP_GetOfficeHourToday]
@today varchar(10)
as
begin
select DayOfTheWeek,OfficeOpenHours,OfficeCloseHours from Office_Hours where DayOfTheWeek=@today
end

UPDATE
********
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[SP_UpdateOfficeOpenCloseHours]

@DayOfTheWeek varchar(10),
@OfficeOpenHours char(4),
@OfficeCloseHours char(4)

as
begin
update Office_Hours set OfficeOpenHours=@OfficeOpenHours,OfficeCloseHours=@OfficeCloseHours where DayOfTheWeek=@DayOfTheWeek
end

DELETE
*******
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[SP_DeleteOfficeHour]
@today varchar(10)
as
begin
Delete from Office_Hours
end

modified on Monday, April 21, 2008 7:52 AM

AnswerRe: How to write the multiple query in single store procedure. Pin
Colin Angus Mackay21-Apr-08 1:22
Colin Angus Mackay21-Apr-08 1:22 
AnswerRe: How to write the multiple query in single store procedure? Pin
Ashfield21-Apr-08 4:30
Ashfield21-Apr-08 4:30 
GeneralRe: How to write the multiple query in single store procedure? Pin
bruze21-Apr-08 5:35
bruze21-Apr-08 5:35 
GeneralRe: How to write the multiple query in single store procedure? Pin
bruze21-Apr-08 5:38
bruze21-Apr-08 5:38 
GeneralRe: How to write the multiple query in single store procedure? Pin
bruze21-Apr-08 5:54
bruze21-Apr-08 5:54 
GeneralRe: How to write the multiple query in single store procedure? Pin
Ashfield21-Apr-08 19:52
Ashfield21-Apr-08 19:52 
GeneralGet all tables in sql server instance Pin
hdv21221-Apr-08 0:12
hdv21221-Apr-08 0:12 
GeneralRe: Get all tables in sql server instance Pin
Blue_Boy21-Apr-08 0:33
Blue_Boy21-Apr-08 0:33 
GeneralSSIS issue dynamic table structure Pin
Mycroft Holmes20-Apr-08 21:29
professionalMycroft Holmes20-Apr-08 21:29 
QuestionHow to design Table Pin
jason_mf20-Apr-08 19:34
jason_mf20-Apr-08 19:34 
Questionsqsh clear screen? Pin
devvvy20-Apr-08 17:57
devvvy20-Apr-08 17:57 
QuestionT-SQl (VS) VB Languages Pin
Feras Mazen Taleb19-Apr-08 19:22
Feras Mazen Taleb19-Apr-08 19:22 
GeneralRe: T-SQl (VS) VB Languages Pin
SimulationofSai20-Apr-08 5:28
SimulationofSai20-Apr-08 5:28 
GeneralRe: T-SQl (VS) VB Languages Pin
Christian Graus20-Apr-08 12:33
protectorChristian Graus20-Apr-08 12:33 
GeneralSQL: BETWEEN Condition by Date Pin
kimo code19-Apr-08 4:53
kimo code19-Apr-08 4:53 
GeneralRe: SQL: BETWEEN Condition by Date Pin
Blue_Boy19-Apr-08 5:09
Blue_Boy19-Apr-08 5:09 
GeneralRe: SQL: BETWEEN Condition by Date Pin
kimo code19-Apr-08 21:25
kimo code19-Apr-08 21:25 

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.