Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7737725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:04:39+00:00 2026-06-01T08:04:39+00:00

I am encountering an error when I am trying to deploy my DB project.

  • 0

I am encountering an error when I am trying to deploy my DB project. I am using SQL Server 2008 R2 and VS 2010. Following is the error message I got.

D:\Solutions\MyDatabase\sql\debug\Database.sql(81,0): Error SQL01268:
.Net SqlClient Data Provider: Msg 911, Level 16, State 4, Procedure
COUNTRY$CurrvalSupport, Line 18 Database ‘sysdb’ does not exist. Make
sure that the name is entered correctly.

I checked my whole solution and found no mention of sysdb. I cant understand what is happening there. Any help on this would be appreciated.

Following is the content of Database.sql file.

    /*
Deployment script for I2
*/

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

SET NUMERIC_ROUNDABORT OFF;


GO
:setvar I2RDB "I2RDB"
:setvar DatabaseName "I2"
: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 LALIT1507. The database for which this script was built, I2, does not exist on this server.', 16, 127) WITH NOWAIT
    RETURN
END

GO

IF (@@servername != 'LALIT1507')
BEGIN
    RAISERROR(N'The server name in the build script %s does not match the name of the target server %s. Verify whether your database project settings are correct and whether your build script is up to date.', 16, 127,N'LALIT1507',@@servername) WITH NOWAIT
    RETURN
END

GO

IF CAST(DATABASEPROPERTY(N'$(DatabaseName)','IsReadOnly') as bit) = 1
BEGIN
    RAISERROR(N'You cannot deploy this update script because the database for which it was built, %s , is set to READ_ONLY.', 16, 127, N'$(DatabaseName)') WITH NOWAIT
    RETURN
END

GO
USE [$(DatabaseName)]
GO
/*
 Pre-Deployment Script Template                         
--------------------------------------------------------------------------------------
 This file contains SQL statements that will be executed before the build script.   
 Use SQLCMD syntax to include a file in the pre-deployment script.          
 Example:      :r .\myfile.sql                              
 Use SQLCMD syntax to reference a variable in the pre-deployment script.        
 Example:      :setvar TableName MyTable                            
               SELECT * FROM [$(TableName)]                 
--------------------------------------------------------------------------------------
*/

/*------------------------------------------------------------------------------------
 Scripts for Infolink 2.2 (oracle) to Infolink 2.3 migration
 -------------------------------------------------------------------------------------
 */

 Print 'Updating null values for dbo.[PROTOCOCOL].[NO_IP_SHIPMENTS_REQUIRED]...'
 UPDATE PROTOCOL SET NO_IP_SHIPMENTS_REQUIRED = 0 WHERE NO_IP_SHIPMENTS_REQUIRED is null;


GO
-- Refactoring step to update target server with deployed transaction logs

GO
/*
Post-Deployment Script Template                         
--------------------------------------------------------------------------------------
 This file contains SQL statements that will be appended to the build script.       
 Use SQLCMD syntax to include a file in the post-deployment script.         
 Example:      :r .\myfile.sql                              
 Use SQLCMD syntax to reference a variable in the post-deployment script.       
 Example:      :setvar TableName MyTable                            
               SELECT * FROM [$(TableName)]                 
--------------------------------------------------------------------------------------
*/

/* ADD DATA READER ROLE TO I2 (used on developer boxes 
--------------------------------------------------------------------------------------*/
EXEC sp_addrolemember 'db_datareader', 'I2'

GO

/* ADD DATA WRITE ROLE TO I2 (used on developer boxes) 
--------------------------------------------------------------------------------------*/
EXEC sp_addrolemember 'db_datawriter', 'I2'

GO

/* SPLIT Czechoslovokia INTO TWO COUNTRIES 
--------------------------------------------------------------------------------------*/
UPDATE COUNTRY SET COUNTRY_NAME = 'Czech Republic' WHERE COUNTRY_NAME = 'Czechoslovakia'

GO

IF (select count (*) from [dbo].[COUNTRY] WHERE COUNTRY_NAME = 'Slovakia') < 1 
BEGIN

INSERT INTO [dbo].[COUNTRY]
           ([ISO_COUNTRY_CODE]
           ,[COUNTRY_NAME]
           ,[INTERNATIONAL_CALLING_CODE]
           ,[STATE_DENOMINATION]
           ,[IORDER]
           ,[OWNER]
           ,[LAST_USER]
           ,[DATE_CREATED]
           ,[DATE_MODIFIED]
           ,[DATE_START]
           ,[VERSION]
           ,[ENTITY_ID]
           ,[RECORD_STATUS])
     VALUES
           (
           'SK'
           ,'Slovakia'
           ,421
           ,'None'
           ,152
           ,NULL
           ,NULL
           ,GETDATE()
           ,GETDATE()
           ,GETDATE()
           ,0
           ,0
           ,0
           )
END

GO

-- M Hardeman - 8/1/2011 - Make sure that the existing protocols have the appropriate PROTOCOL_STATUS record (originals were done in script, and didn't have any)
-- B Dickson - 06-0CT-2011 - I was wondering why there was 13 million rows in protocol table for the dev db.
--UPDATE PROTOCOL SET PROTOCOL_STATUS = 'Deleted' WHERE RECORD_STATUS = 2
--GO

--UPDATE PROTOCOL SET PROTOCOL_STATUS = 'Inactive' WHERE RECORD_STATUS = 1
--GO

-- N Craver 8/30/2011 - Sync all code list items that exist in Documents to Track but not Document Type
Insert Into CODE_LIST_ITEM (PROTOCOL_ID, REF_NAME, CODE_LIST_ITEM_VALUE, CODE_LIST_ITEM_TEXT, I_ORDER, CODE_LIST_ITEM_TYPE, 
  [OWNER], LAST_USER, DATE_CREATED, [VERSION], ENTITY_ID, RECORD_STATUS, IS_CUSTOMIZABLE, DATE_START)
SELECT [PROTOCOL_ID]
      ,Replace(Ref_Name, 'DocumentsToTrack_', 'DocumentType_')
      ,[CODE_LIST_ITEM_VALUE]
      ,[CODE_LIST_ITEM_TEXT]
      ,[I_ORDER]
      ,'DocumentType'
      ,[OWNER]
      ,[LAST_USER]
      ,GETDATE()
      ,1
      ,[ENTITY_ID]
      ,[RECORD_STATUS]
      ,[IS_CUSTOMIZABLE]
      ,GETDATE()
  FROM [I2].[dbo].[CODE_LIST_ITEM] cli
  WHERE CODE_LIST_ITEM_TYPE = 'DocumentsToTrack'
    And Not Exists(Select 1
                     From CODE_LIST_ITEM dttcli
                    Where cli.CODE_LIST_ITEM_TEXT = dttcli.CODE_LIST_ITEM_TEXT
                      And cli.PROTOCOL_ID = dttcli.PROTOCOL_ID
                      And dttcli.CODE_LIST_ITEM_TYPE = 'DocumentType')

    GO


IF (select count (*) from [dbo].[STUDY_ISSUE_STATUS] WHERE NAME = 'Opened') < 1
BEGIN

    INSERT INTO [dbo].[STUDY_ISSUE_STATUS]
               ([PROTOCOL_ID]
               ,[NAME]
               ,[DESCRIPTION]
               ,[DATE_CREATED]
               ,[LAST_USER]
               ,[DATE_MODIFIED]
               ,[ENTITY_ID]
               ,[RECORD_STATUS]
               ,[OWNER])
         VALUES
               (
                   (SELECT TOP(1) ID FROM PROTOCOL)
                   ,'Opened'
                   ,'The issue has been opened'
                   ,GETDATE()
                   ,'I2'
                   ,NULL
                   ,0
                   ,0
                   ,NULL
               )
END

IF (select count (*) from [dbo].[STUDY_ISSUE_STATUS] WHERE NAME = 'Closed') < 1
BEGIN

    INSERT INTO [dbo].[STUDY_ISSUE_STATUS]
               ([PROTOCOL_ID]
               ,[NAME]
               ,[DESCRIPTION]
               ,[DATE_CREATED]
               ,[LAST_USER]
               ,[DATE_MODIFIED]
               ,[ENTITY_ID]
               ,[RECORD_STATUS]
               ,[OWNER])
         VALUES
               (
                   (SELECT TOP(1) ID FROM PROTOCOL)
                   ,'Closed'
                   ,'The issue is closed'
                   ,GETDATE()
                   ,'I2'
                   ,NULL
                   ,0
                   ,0
                   ,NULL
               )

END

GO

-- M Hardeman - Fix for bug number 1428 - adding a new dropdown for Pending CSA/Budget to the dropdown menu for IRB status on 
-- Protocol Site IRB/EC Approval Renewal Page

IF (select count (*) from [dbo].CODE_LIST_ITEM WHERE CODE_LIST_ITEM_VALUE = 'Pending CSA/Budget' AND CODE_LIST_ITEM_TYPE = 'IrbEcApprovalStatus') < 1
BEGIN


UPDATE CODE_LIST_ITEM SET REF_NAME = 'IrbEcApprovalStatus_6' WHERE REF_NAME = 'IrbEcApprovalStatus_5' And Entity_Id = 0

UPDATE CODE_LIST_ITEM SET I_ORDER = 6 WHERE REF_NAME = 'IrbEcApprovalStatus_6' And Entity_Id = 0

INSERT INTO CODE_LIST_ITEM 
(
    PROTOCOL_ID, 
    REF_NAME, 
    CODE_LIST_ITEM_VALUE, 
    CODE_LIST_ITEM_TEXT, 
    I_ORDER, 
    CODE_LIST_ITEM_TYPE, 
    [OWNER], 
    LAST_USER, 
    DATE_CREATED, 
    [VERSION], 
    ENTITY_ID, 
    RECORD_STATUS, 
    IS_CUSTOMIZABLE, 
    DATE_START
    )
VALUES
(   
      0
      ,'IrbEcApprovalStatus_5'
      ,'Pending CSA/Budget'
      ,'Pending CSA/Budget'
      ,5
      ,'IrbEcApprovalStatus'
      ,'No user logged'
      ,'No user logged'
      ,GETDATE()
      ,1
      ,0
      ,0
      ,0
      ,NULL
)


INSERT INTO CODE_LIST_ITEM 
(
    PROTOCOL_ID, 
    REF_NAME, 
    CODE_LIST_ITEM_VALUE, 
    CODE_LIST_ITEM_TEXT, 
    I_ORDER, 
    CODE_LIST_ITEM_TYPE, 
    [OWNER], 
    LAST_USER, 
    DATE_CREATED, 
    [VERSION], 
    ENTITY_ID, 
    RECORD_STATUS, 
    IS_CUSTOMIZABLE, 
    DATE_START
    )
VALUES
(   
      -1
      ,'IrbEcApprovalStatus_5'
      ,'Pending CSA/Budget'
      ,'Pending CSA/Budget'
      ,5
      ,'IrbEcApprovalStatus'
      ,'No user logged'
      ,'No user logged'
      ,GETDATE()
      ,1
      ,0
      ,0
      ,0
      ,NULL
)

END
GO

    -- M Hardeman - 8/4/2011 - Fix for bug 1489, added two new dropdowns for contact role on protocol site

IF (select count (*) from [dbo].[ROLE_INFO] WHERE ROLE_NAME = 'Contract' AND ROLE_TYPE = 'ProtocolSite') < 1
BEGIN

INSERT INTO [dbo].[ROLE_INFO]
(
  [ROLE_NAME]
  ,[OWNER]
  ,[LAST_USER]
  ,[DATE_CREATED]
  ,[DATE_MODIFIED]
  ,[DATE_START]
  ,[VERSION]
  ,[ENTITY_ID]
  ,[RECORD_STATUS]
  ,[PROTOCOL_ID]
  ,[ROLE_INFO_ID]
  ,[ROLE_TYPE]
  ,[IS_DEFAULT]
  ,[TEMPLATE_ID]
  ,[ROLE_INFO_XML]
)
VALUES
(
    'Contract'
    ,'i2system'
    ,'i2system'
    ,GETDATE()
    ,GETDATE()
    ,GETDATE()
    ,1
    ,0
    ,0
    ,-1
    ,(SELECT ID FROM ROLE_INFO WHERE ROLE_NAME='Site Roles')
    ,'ProtocolSite'
    ,NULL
    ,NULL
    ,NULL
)

END

GO


IF (select count (*) from [dbo].[ROLE_INFO] WHERE ROLE_NAME = 'Budget' AND ROLE_TYPE = 'ProtocolSite') < 1
BEGIN

INSERT INTO [dbo].[ROLE_INFO]
(
  [ROLE_NAME]
  ,[OWNER]
  ,[LAST_USER]
  ,[DATE_CREATED]
  ,[DATE_MODIFIED]
  ,[DATE_START]
  ,[VERSION]
  ,[ENTITY_ID]
  ,[RECORD_STATUS]
  ,[PROTOCOL_ID]
  ,[ROLE_INFO_ID]
  ,[ROLE_TYPE]
  ,[IS_DEFAULT]
  ,[TEMPLATE_ID]
  ,[ROLE_INFO_XML]
)
VALUES
(
    'Budget'
    ,'i2system'
    ,'i2system'
    ,GETDATE()
    ,GETDATE()
    ,GETDATE()
    ,1
    ,0
    ,0
    ,-1
    ,(SELECT ID FROM ROLE_INFO WHERE ROLE_NAME='Site Roles')
    ,'ProtocolSite'
    ,NULL
    ,NULL
    ,NULL
)

END

GO    


Update CODE_LIST_ITEM
Set CODE_LIST_ITEM_VALUE = '0|IND Safety Report' Where CODE_LIST_ITEM_VALUE = '0|IIND Safety Report' And CODE_LIST_ITEM_TYPE = 'DocumentType' And Entity_Id = 0

GO

-- Fix bug 1535
UPDATE CODE_LIST_ITEM  
Set CODE_LIST_ITEM_TEXT = 'Pharmacovigilance', CODE_LIST_ITEM_VALUE = 'Pharmacovigilance'
Where CODE_LIST_ITEM_TEXT = 'Pharamcovigilance'
  And CODE_LIST_ITEM_VALUE = 'Pharamcovigilance'
  And CODE_LIST_ITEM_TYPE = 'Department'
  And RECORD_STATUS = 0
  And ENTITY_ID = 0
GO

If Not Exists(Select 1 From CODE_LIST_ITEM Where CODE_LIST_ITEM_TYPE = 'Department' And CODE_LIST_ITEM_TEXT = 'Study Startup' And PROTOCOL_ID In (0, -1))
Begin
    INSERT INTO CODE_LIST_ITEM 
    (
        PROTOCOL_ID, 
        REF_NAME, 
        CODE_LIST_ITEM_VALUE, 
        CODE_LIST_ITEM_TEXT, 
        I_ORDER, 
        CODE_LIST_ITEM_TYPE, 
        [OWNER], 
        LAST_USER, 
        DATE_CREATED, 
        [VERSION], 
        ENTITY_ID, 
        RECORD_STATUS, 
        IS_CUSTOMIZABLE, 
        DATE_START
        )
    Select 0, 'Department_24', 'Study Startup', 'Study Startup', 24, 'Department', 'No user logged', 'No user logged', GETDATE(), 1, 0, 0, 0, NULL
    Union   
    Select -1, 'Department_24', 'Study Startup', 'Study Startup', 24, 'Department', 'No user logged', 'No user logged', GETDATE(), 1, 0, 0, 0, NULL
END
GO

--Fix for bug 1574
Update CODE_LIST_ITEM 
Set RECORD_STATUS = 2
Where CODE_LIST_ITEM_TEXT In('SEV Confirmation Letter', 'SEV Follow-up Letter', 'Site Evaluation Visit Report',
                             'SIV Confirmation Letter', 'SIV Follow-up Letter', 'Site Initiation Visit Report',
                             'IMV Confirmation Letter', 'IMV Follow-up Letter', 'Interim Monitoring Visit Report', '(020) Interim Monitoring Visit Report',
                             'COV Confirmation Letter', 'COV Follow-up Letter', 'Closeout Visit Report')
And CODE_LIST_ITEM_TYPE In ('DocumentType')
And RECORD_STATUS <> 2
And ENTITY_ID = 0

GO
--Adding NA to Site Document Status Dropdown
If Not Exists(SELECT 1 From CODE_LIST_ITEM Where CODE_LIST_ITEM_TEXT = 'N/A' AND
CODE_LIST_ITEM_TYPE='DocumentStatus')
Begin

INSERT INTO CODE_LIST_ITEM
(
CODE_LIST_ITEM_VALUE,
CODE_LIST_ITEM_TEXT,
CODE_LIST_ITEM_TYPE,
PROTOCOL_ID,
REF_NAME,
I_ORDER,
OWNER,
LAST_USER,
VERSION,
IS_CUSTOMIZABLE
)
VALUES
(
'N/A',
'N/A',
'DocumentStatus',
'-1',
'DocumentStatus_3',
'3',
'No user logged',
'No user logged',
'1',
'0'
)
END
GO

UPDATE Code_LIST_ITEM 
SET PROTOCOL_ID='0' 
WHERE PROTOCOL_ID='-1'
AND CODE_LIST_ITEM_TEXT='N/A' 
AND CODE_LIST_ITEM_TYPE='DocumentStatus';


GO

--Fix for bug 1589
/*If Not Exists(SELECT 1 From CODE_LIST_ITEM Where CODE_LIST_ITEM_TEXT = 'Regulatory Contact' AND CODE_LIST_ITEM_TYPE='ProtocolSiteTitle')
Begin

INSERT INTO CODE_LIST_ITEM
(

CODE_LIST_ITEM_VALUE,
CODE_LIST_ITEM_TEXT,
CODE_LIST_ITEM_TYPE,
PROTOCOL_ID,
REF_NAME,
I_ORDER,
CODE_LIST_ITEM_TYPE,
OWNER,
LAST_USER,
VERSION,
IS_CUSTOMIZABLE


-- it needs more than this
-- it needs to be associated with the correct codelist as well

)
VALUES
(

'Regulatory Contact',
'Regulatory Contact',
'ProtocolSiteTitle',
'-1',
'ProtocolSiteTitle_21',
'21',
'ProtocolSiteTitle',
'No user logged',
'No user logged',
'1',
'0'

)
END*/

GO
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:04:40+00:00Added an answer on June 1, 2026 at 8:04 am

    I finally found the issue. The database was ported from Oracle to SQL some time back and there were some references left in DB triggers that were not removed by the tool used for porting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been encountering the following error when trying to build a session factory: PersistenceTests.Can_Map_Orders_To_Database
I'm learning Kohana at the mo and encountering the following error when trying to
I'm trying to store a file in an SQL Server database and am using ASP.NET
Since yesterday I started encountering errors related to date formats in SQL Server 2008.
I am encountering the following error in my app. upon starting it: [3/26/12 13:05:26:109
I'm trying to create a payment calculator, however I am encountering an error in
I'm trying to implement SQL CE in a WP7 Mango project, but now I'm
I am trying to implement Error handling using Action Filters Attributes as per ScottGu's
I'm encountering a very annoying error using Core Data on Mac OS X 10.5.
I'm trying to change an existing SQL NText column to nvcharmax(max) , and encountering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.