Click here to Skip to main content
15,891,136 members
Home / Discussions / Database
   

Database

 
QuestionIs there a try/finally construct in sqlcmd with -b option, guaranteed to execute the finally block? Pin
muhalet27-Sep-12 0:56
muhalet27-Sep-12 0:56 
AnswerRe: Is there a try/finally construct in sqlcmd with -b option, guaranteed to execute the finally block? Pin
Eddy Vluggen27-Sep-12 1:42
professionalEddy Vluggen27-Sep-12 1:42 
GeneralRe: Is there a try/finally construct in sqlcmd with -b option, guaranteed to execute the finally block? Pin
J4amieC27-Sep-12 2:51
J4amieC27-Sep-12 2:51 
QuestionRe: Is there a try/finally construct in sqlcmd with -b option, guaranteed to execute the finally block? Pin
Eddy Vluggen27-Sep-12 4:27
professionalEddy Vluggen27-Sep-12 4:27 
AnswerRe: Is there a try/finally construct in sqlcmd with -b option, guaranteed to execute the finally block? Pin
J4amieC27-Sep-12 21:29
J4amieC27-Sep-12 21:29 
Questionsql script Pin
sindhuan26-Sep-12 20:08
sindhuan26-Sep-12 20:08 
AnswerRe: sql script Pin
Ingo26-Sep-12 21:10
Ingo26-Sep-12 21:10 
GeneralRe: sql script Pin
sindhuan26-Sep-12 21:21
sindhuan26-Sep-12 21:21 
ya..I have given the code below
/*
Deployment script for Test2
*/


GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;

SET NUMERIC_ROUNDABORT OFF;


GO
:setvar DatabaseName "Test2"
:setvar DefaultDataPath "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\"
:setvar DefaultLogPath "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\"

GO
:on error exit
GO
USE [master]
GO

IF (DB_ID(N'$(DatabaseName)') IS NOT NULL
AND DATABASEPROPERTYEX(N'$(DatabaseName)','Status') <> N'ONLINE')
BEGIN
RAISERROR(N'The state of the target database, %s, is not set to ONLINE. To deploy to this database, its state must be set to ONLINE.', 16, 127,N'$(DatabaseName)') WITH NOWAIT
RETURN
END
GO

IF NOT EXISTS (SELECT 1 FROM [master].[dbo].[sysdatabases] WHERE [name] = N'$(DatabaseName)')
BEGIN
RAISERROR(N'You cannot deploy this update script to target INP-X. The database for which this script was built,Test2, does not exist on this server.', 16, 127) WITH NOWAIT
RETURN
END

GO
AnswerRe: sql script Pin
Ingo26-Sep-12 21:44
Ingo26-Sep-12 21:44 
AnswerRe: sql script Pin
J4amieC26-Sep-12 21:46
J4amieC26-Sep-12 21:46 
GeneralRe: sql script Pin
sindhuan26-Sep-12 23:30
sindhuan26-Sep-12 23:30 
AnswerRe: sql script Pin
Ingo27-Sep-12 0:07
Ingo27-Sep-12 0:07 
GeneralRe: sql script Pin
Eddy Vluggen27-Sep-12 0:22
professionalEddy Vluggen27-Sep-12 0:22 
GeneralRe: sql script Pin
J4amieC27-Sep-12 1:06
J4amieC27-Sep-12 1:06 
QuestionLine line is a select statement. Pin
vanikanc26-Sep-12 8:22
vanikanc26-Sep-12 8:22 
AnswerRe: Line line is a select statement. Pin
jschell26-Sep-12 8:37
jschell26-Sep-12 8:37 
GeneralRe: Line line is a select statement. Pin
vanikanc26-Sep-12 8:39
vanikanc26-Sep-12 8:39 
GeneralRe: Line line is a select statement. Pin
jschell27-Sep-12 9:57
jschell27-Sep-12 9:57 
AnswerRe: Line line is a select statement. Pin
Niju126-Sep-12 22:28
Niju126-Sep-12 22:28 
AnswerRe: Line line is a select statement. Pin
Ingo26-Sep-12 23:04
Ingo26-Sep-12 23:04 
QuestionAttendance and leave of employees Pin
Amr Muhammed25-Sep-12 13:06
Amr Muhammed25-Sep-12 13:06 
AnswerRe: Attendance and leave of employees Pin
Ingo25-Sep-12 20:50
Ingo25-Sep-12 20:50 
GeneralRe: Attendance and leave of employees Pin
Andrei Straut25-Sep-12 21:03
Andrei Straut25-Sep-12 21:03 
GeneralRe: Attendance and leave of employees Pin
Ingo25-Sep-12 21:19
Ingo25-Sep-12 21:19 
GeneralRe: Attendance and leave of employees Pin
Andrei Straut25-Sep-12 21:20
Andrei Straut25-Sep-12 21:20 

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.