This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How to check the database existance in the Sql server
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 04, 2008
01:05 AM
How to check the database existance in the Sql server
Hi ,
I am using basic MSI project.
With the help of SQLLogin dialogs we can create the new databse in the server.
But i am unable to inform the user whether the database is alraedy exist in the server or not.
How can i do that?
I am using basic MSI project.
With the help of SQLLogin dialogs we can create the new databse in the server.
But i am unable to inform the user whether the database is alraedy exist in the server or not.
How can i do that?
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 04, 2008
02:18 AM
You can add sql script follow;) :
IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'IS_SQLSERVER_DATABASE')
BEGIN
CREATE DATABASE [IS_SQLSERVER_DATABASE]
END
GO
IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'IS_SQLSERVER_DATABASE')
BEGIN
CREATE DATABASE [IS_SQLSERVER_DATABASE]
END
GO
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 04, 2008
03:59 AM
Thanks For ur quick response.
But how to inform the user about the existance of the Database.
e.g:
I want to display a message to the user that "The data base is already exist.
Do you want to reuse it?"
And according to the response i want to do some work.
how ?
But how to inform the user about the existance of the Database.
e.g:
I want to display a message to the user that "The data base is already exist.
Do you want to reuse it?"
And according to the response i want to do some work.
how ?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 07, 2008
07:33 PM
Use InstallScript:
Function DataBaseInUse(szConnection, szServer, bTrust, szUserName, szPassword, svDB )
LIST listDBs;
NUMBER i;
begin
listDBs = SQLRTGetDatabases( szConnection, szServer, bTrust, szUserName, szPassword );
for i=0 to listDBs.Count
if(svDB = listDBs) then
MessageBox("information",WARMING);
endif
endfor;
end;
Function DataBaseInUse(szConnection, szServer, bTrust, szUserName, szPassword, svDB )
LIST listDBs;
NUMBER i;
begin
listDBs = SQLRTGetDatabases( szConnection, szServer, bTrust, szUserName, szPassword );
for i=0 to listDBs.Count
if(svDB = listDBs) then
MessageBox("information",WARMING);
endif
endfor;
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2008
11:26 AM
If you are using a Basic MSI or InstallScript MSI project, existing database names will be set to the IS_SQLSERVER_LIST Windows Installer property in a comma delimited manner after you call the ISSQLQueryDatabases action.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2009
07:57 AM
sorry but itsn't correct :
that occurs with the list of SQL SERVERS and "IS_SQLSERVER_FLATLIST" property., but not with the list of catalogs into IS_SQLSERVER_LIST
knows someone a way to do this?,
retrieve the catalog list of M$ SQL SERVER into a windows installer property
hidenori wrote:
If you are using a Basic MSI or InstallScript MSI project, existing database names will be set to the IS_SQLSERVER_LIST Windows Installer property....
that occurs with the list of SQL SERVERS and "IS_SQLSERVER_FLATLIST" property., but not with the list of catalogs into IS_SQLSERVER_LIST
knows someone a way to do this?,
retrieve the catalog list of M$ SQL SERVER into a windows installer property