"sql server version control" Code Answer's
You're definitely familiar with the best coding language SQL that developers use to develop their projects and they get all their queries like "sql server version control" answered properly. Developers are finding an appropriate answer about sql server version control related to the SQL coding language. By visiting this online portal developers get answers concerning SQL codes question like sql server version control. Enter your desired code related query in the search bar and get every piece of information about SQL code related question on sql server version control.
sql server version control
IF OBJECT_ID('dbo.p_DBVersion') IS NULL
EXEC('CREATE PROCEDURE dbo.p_DBVersion AS SELECT 1')
GO
ALTER PROCEDURE dbo.p_DBVersion
@NEW_VERSION char(16) = NULL
AS
/*
Nom: p_DBVersion
Autor: Miquel Martí
Creació: 18/03/19
Propòsit: Asignar o consultar versió de la BBDD
Ús: EXEC p_DBVersion
EXEC p_DBVersion '1.1'
Historial: 18/03/19 - Miquel Martí
+ Creació inicial
*/
DECLARE @OLD_VERSION AS char(16)
SET NOCOUNT ON
-- consultar versió actual
SELECT @OLD_VERSION = CAST([value] as char(16))
FROM ::fn_listextendedproperty('Database Revision', default, default, default, default, default, default)
-- si no existeix, asignar-li v0.0
IF RTRIM(@OLD_VERSION) IS NULL
SET @OLD_VERSION = '0.0'
-- si no s'especifica una nova versió, informar de l'actual
IF RTRIM(@NEW_VERSION) IS NULL BEGIN
SET @NEW_VERSION = @OLD_VERSION
PRINT 'Database Revision is ' + 'v' + RTRIM(@NEW_VERSION)
END
ELSE BEGIN-- si s'especifica, informar-ne
PRINT 'Upgraded Database Revision from ' + 'v' + RTRIM(@OLD_VERSION) + ' to v' + RTRIM(@NEW_VERSION)
END
-- actualitza Database Revision com a propietat avançada
IF EXISTS (SELECT 1 FROM fn_listextendedproperty(N'Database Revision', NULL, NULL, NULL, NULL, NULL, NULL))
EXEC sp_dropextendedproperty N'Database Revision', NULL, NULL, NULL, NULL, NULL, NULL
EXEC sp_addextendedproperty N'Database Revision', @NEW_VERSION, NULL, NULL, NULL, NULL, NULL, NULL
GO
All those coders who are working on the SQL based application and are stuck on sql server version control can get a collection of related answers to their query. Programmers need to enter their query on sql server version control related to SQL code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about sql server version control for the programmers working on SQL code while coding their module. Coders are also allowed to rectify already present answers of sql server version control while working on the SQL language code. Developers can add up suggestions if they deem fit any other answer relating to "sql server version control". Visit this developer's friendly online web community, CodeProZone, and get your queries like sql server version control resolved professionally and stay updated to the latest SQL updates.