MSSQL - Knowledge Base Archives - Hivelocity Hosting https://www.hivelocity.net/kb/tag/mssql/ Dedicated Servers, Private Cloud & Colocation Fri, 01 Mar 2024 14:12:26 +0000 en-US hourly 1 https://wordpress.org/?v=6.6 How to Install SQL Server Management Studio 2017 on Windows Server 2019 https://www.hivelocity.net/kb/how-to-install-sql-server-management-studio-2017-on-windows-server-2019/ Wed, 03 Apr 2019 19:39:50 +0000 https://www.hivelocity.net/?post_type=hv_knowledgebase&p=11875 SQL Server Management Studio 2017 Windows 2019 Download This guide will assist you through the download and installation process of SQL Server Management Studio 2017 on Windows Server 2019. SQL Server Management Studio (SSMS) is an invaluable tool for managing a Microsoft SQL server. It can be installed on your own computer and connected to …

How to Install SQL Server Management Studio 2017 on Windows Server 2019 Read More »

The post How to Install SQL Server Management Studio 2017 on Windows Server 2019 appeared first on Hivelocity Hosting.

]]>
SQL Server Management Studio 2017 Windows 2019 Download

This guide will assist you through the download and installation process of SQL Server Management Studio 2017 on Windows Server 2019. SQL Server Management Studio (SSMS) is an invaluable tool for managing a Microsoft SQL server. It can be installed on your own computer and connected to the SQL Server or installed directly on the server itself.

As of this writing SQL Server Management Studio 2017 and Windows Server 2019 are the newest versions but the install instructions for all modern versions are very similar to these.

  1. First, log in to your Windows Server with the Administrator account.
  2. Open your browser and navigate to the SSMS download page (https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017)
    SQL Server Management Studio 2017 download page.
  3. Download the version of SQL Server Management Studio you would like to use. As of this writing, that version is 18.0 (RC1).
    SSMS Version 18.0 (RC1) with Download option highlighted
  4. Once the download completes double click on the installer in your downloads folder.
    SSMS Installer icon within the downloads folder
  5. The installer will appear. Click install and wait for the installer to complete. This may take several minutes.
    SQL Server Management Studio Installer welcome screen
    SSMS 2017 install screen progress bar
  6. Once you see the following Setup Complete message click the Close button.
    SQL Server Management Studio 2017 install completion screen
  7. Click the Start button and look for a program called Microsoft SQL Server Management Studio 18 and click on it.
    Start Menu showing SQL Server Management Studio 18 launch button
  8. Success! SSMS will launch and you can begin using it.

    SQL Server Management Studio 2017 Sign in Screen

And there you have it! Thank you for reading our guide, and f you run into any issues installing SSMS 2017 please do not hesitate to open a support ticket. Our Support team will be more than happy to assist you.

 

Popular Links

Looking for more information on MSSQL? Search our Knowledge Base!

Interested in more articles about Databases? Navigate to our Categories page using the bar on the left or check out these popular articles:

Popular tags within this category include: MySQL, MSSQL, phpMyAdmin, PostgreSQL, and more.

Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.

 

The Hivelocity Difference

Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.

With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.

Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.

The post How to Install SQL Server Management Studio 2017 on Windows Server 2019 appeared first on Hivelocity Hosting.

]]>
How to Install SQL Server 2016 Express https://www.hivelocity.net/kb/how-to-install-sql-server-2016-express/ Mon, 25 Mar 2019 19:38:52 +0000 https://www.hivelocity.net/?post_type=hv_knowledgebase&p=11873 Downloading and Installing SQL Server 2016 Express Edition If you’re trying to install SQL Server 2016 express, you’ll need to make sure you’ve taken a few important steps first. SQL Server express requires .NET Framework 4.6 be installed. You can check before installing SQL Server, but luckily, SQL Server 2016 express will automatically check and …

How to Install SQL Server 2016 Express Read More »

The post How to Install SQL Server 2016 Express appeared first on Hivelocity Hosting.

]]>
Downloading and Installing SQL Server 2016 Express Edition

If you’re trying to install SQL Server 2016 express, you’ll need to make sure you’ve taken a few important steps first. SQL Server express requires .NET Framework 4.6 be installed. You can check before installing SQL Server, but luckily, SQL Server 2016 express will automatically check and install it if needed. Additionally, if you are running Windows Server 2012 R2, windows update KB2919355 is required before installing the SQL framework.

  1. First, Download the executable from the Microsoft site:
    https://www.microsoft.com/en-us/download with the latest version being https://www.microsoft.com/en-us/download/details.aspx?id=103447

  2. Next, you’ll need to choose your installation type. For now, we’ll choose “Basic“, but if you have custom options or location you’d like to set, you can skip ahead to the next section where we’ll cover installing SQL Server 2016 express using custom parameters.

    Window showing SQL Server 2016 express edition Installation types with "Basic" installation selected
    Window showing SQL Server 2016 express edition Installation types with “Basic” installation selected
  3. After selecting your installation type, you’ll need to Accept the license agreement.

    Window showing a segment of the license agreement for SQL Server 2016 with SP3 Express Edition
    Window showing a segment of the license agreement for SQL Server 2016 with SP3 Express Edition
  4. From there, you’ll need to choose a new install location, or if you’re fine with the default location, you can simply click Install.

    Window showing the install location options for SQL Server 2016 express
    Window showing the install location options for SQL Server 2016 express
    Window showing the download and installation progress bars
    Window showing the download progress bar
  5. Complete! From here you can Connect to the server immediately, Customize the installation, or Install SQL Server Management Studio.
Window showing the SQL Server Installation complete menu
Window showing the SQL Server Installation complete menu

Installing SQL Server 2016 Express with Custom Parameters

Sometimes, the basic installation option doesn’t fit your specific needs. If you’d like to set install locations, install or remove certain features, or confirm the pre-check tests, instead of choosing “Basic” when prompted on the installation type screen, choose “Custom“.

Window showing SQL Server 2016 express edition Installation types with "Custom" installation selected
Window showing SQL Server 2016 express edition Installation types with “Custom” installation selected
  1. First, you’ll need to select the download location for the installer and click Install.

    Window instructing the user to specify a SQL Server media download target location
    Window instructing the user to specify a SQL Server media download target location
    Window showing the progress bar for downloading the package
    Window showing the progress bar for downloading the package
  2. After the download is complete, you will be directed to the Server Installation Center. From here you have several options. To start, select the option labelled New SQL Server stand-alone installation.

    Window showing the SQL Server installation center with various options
    Window showing the SQL Server installation center with various options
  3. Accept the license agreement and select Next.
    Sample of the SQL Server Express 2016 License Agreement
    Sample of the SQL Server Express 2016 License Agreement
  4. The next screen will attempt to diagnose any potential issues that may occur during installation. If any of the rules fail, they can be resolved here by clicking on the link under the status column of any failed rules. Afterwards, select Re-run to attempt the test again. Once all of the entries in the Status column show ‘Passed’, select Next at the bottom of the screen.

    Window showing the SQL Server Express Global Rules with 9 passed and 0 failed
    Window showing the SQL Server Express Global Rules with 9 passed and 0 failed
  5. The next screen gives you the option to turn Automatic Updates on to monitor your SQL Server instance and download updates as needed. If you’d like to use this, select the checkbox marked “Use Microsoft Update” and select Next.

    Window showing options to turn on automatic updates
    Window showing options to turn on automatic updates
  6. Here, the SQL Server will attempt to check again for any more issues you will need to be aware of related to your installation. Resolve any failed issues using the same method as before and hit Re-run. Once all tests have passed, select Next.

    SQL Server Installation with Install Rules Check List and a "Windows Firewall Check Result" Warning to Inform That You Might Need to Add Firewall Rules
    SQL Server Installation with Install Rules Check List and a “Windows Firewall Check Result” Warning to Inform That You Might Need to Add Firewall Rules
  7. On the Feature Selection screen, you are given options to choose the features and installation directories you prefer. You can see descriptions of each feature and required prerequisites in the top right of the window. If you don’t have any preferences, you can use the default settings and select Next.

    Window showing available SQL Server features with descriptions of each
    Window showing available SQL Server features with descriptions of each
  8. After selecting your desired features, SQL will attempt to check its rules again, this time focusing on your recently selected features. These tests should pass automatically. If there is a failed test, you can resolve it by clicking the link and following the instructions, same as before. After all tests have passed, select Next.

    Window showing the SQL Server Feature Rules
    Window showing the SQL Server Feature Rules
  9. The next screen will prompt you to choose a name and ID for your server instance. You may also choose to leave it default. Afterwards, select Next.
    Instance configuration screen showing form fields for renaming your SQL instance and ID
    Instance configuration screen showing form fields for renaming your SQL instance and ID

     

  10. On the Server Configuration screen, you’ll be given options to configure windows service accounts that SQL will be using to run the instance. You can leave this default unless you want to specify a different account. When you’re done, select Next.

    Window showing SQL Server configuration options
    Window showing SQL Server configuration options
  11. Next, you’ll be given the option to specify administrators for your SQL instance. Either use the default Windows Administrator account, or alternatively select the “Mixed Mode” and specify a password for the system administrator account. Once you’re finished here, simply click Next.

    Database engine configuration screen with options for selecting system administrators
    Database engine configuration screen with options for selecting system administrators
  12. This next screen gives you options to install and configure reporting services. We’ll use the default option here and select Next.

    Window showing SQL Server 2016 express reporting service options
    Window showing SQL Server 2016 express reporting service options
  13. This final screen is a consent form stating that you are choosing to install Microsoft R Open. After selecting Accept and clicking Next, SQL will begin the installation.

    Microsoft R Open consent form
    Microsoft R Open consent form
    Screen showing the SQL Server 2016 Express installation progress bar
    Screen showing the SQL Server 2016 Express installation progress bar
  14. Setup is now complete! Upon completion, SQL Server will present you with a comprehensive list of everything that succeeded or failed. You can navigate through the SQL Server Installation Center and proceed to install any additional, more specific tools you may require.
    Installation completion screen showing a list of features that have succeeded or failed to install
    Installation completion screen showing a list of features that have succeeded or failed to install

     

Popular Links

Looking for more information on MSSQL? Search our Knowledge Base!

Interested in more articles about Databases? Navigate to our Categories page using the bar on the left or check out these popular articles:

Popular tags within this category include: MySQL, MSSQL, phpMyAdmin, PostgreSQL, and more.

Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.

 

The Hivelocity Difference

Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.

With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.

Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.

The post How to Install SQL Server 2016 Express appeared first on Hivelocity Hosting.

]]>
How to install SQL Server 2012 Express on Windows server 2012 https://www.hivelocity.net/kb/how-to-install-sql-server-2012-express-on-windows-server-2012/ Thu, 27 Aug 2015 20:17:39 +0000 https://www.hivelocity.net/?post_type=hv_knowledgebase&p=11930 Installing SQL Server 2012 Express Before installing SQL Server 2012 make sure you have the below components installed or enabled on your Windows server. Download and install .NET Framework 4.0. If the computer has Internet access, SQL Server setup will download it when needed. Enable .NET Framework 3.5 using Control Panel -> Programs and Features …

How to install SQL Server 2012 Express on Windows server 2012 Read More »

The post How to install SQL Server 2012 Express on Windows server 2012 appeared first on Hivelocity Hosting.

]]>
Installing SQL Server 2012 Express

Before installing SQL Server 2012 make sure you have the below components installed or enabled on your Windows server.

  1. Download and install .NET Framework 4.0. If the computer has Internet access, SQL Server setup will download it when needed.

  2. Enable .NET Framework 3.5 using Control Panel -> Programs and Features -> Turn on/off features

Now go through the next steps for the installation.

  1. Login to your Windows server with the administrator user.

  2. Download the proper SQL server set up from the link: https://www.microsoft.com/en-us/download

  3. Double click the installer file and then click on RUN

    Screenshot of SQL Server 2012 Express Installation window with "Run" button selected

  4. The set up file will start extracting the installation files

    Window showing installation progress bar

  5. On the next screen choose the top option to install a new stand-alone installation and click on it.

    SQL Server Installation Center window with "New SQL Server Installation" highlighted

  6. The set up will process the basic operations and you will see the licensing screen where you have to check the box for “I accept the license terms” click on next.

    SQL Server 2012 Express Licensing agreement

  7. The next screen will be Product Updates. SQL server will check for and install any updates. Leave it as it is and click on next.

    SQL Server 2012 product updates page

  8. On The next screen you will see that the set up is getting ready for installations.

    SQL Server 2012 Express setup page

  9. On the Feature Selection page, please select the features you would like to install. A description of each feature will appear on the “Feature description” area when you click on a feature. Click on Next.

    SQL Server 2012 Express setup page showing feature options and descriptions

  10. On the Instance Configuration page, choose a name for the instance or select a default instance. SQLExpress is the name of the instance as we have selected Named Instance. Click on Next.

    Instance Configuration page with "Named Instance" highlighted

  11. The next step is server configuration. From here you can change the Windows services associated with this instance of SQL Server. You can keep the defaults here unless you want to specify different user accounts for the services. You can also change the default collation settings if you are not in the United States. Click Next to continue.

    SQL Server 2012 Server Configuration page with "Collation" tab highlighted

  12. The next step is Database Engine configuration. On the Server Configuration tab you can select whether SQL Server will only authenticate using Windows accounts or you can choose Mixed Mode which will allow Windows accounts and SQL accounts. Mixed mode authentication is generally used so we will select it. Provide the password for “sa” user and then click on next.

    SQL Server 2012 Database Engine Configuration page

  13. On the Data Directories tab you can change the locations of log files and other files that SQL will use. Depending on your server configuration and the load that will be put on SQL, you may want to put the database and log folders on separate drives. For most users, you can leave the default values. Click on next.

    Database Engine Configuration page with "Data Directories" tab highlighted

  14. The next screen is of Error Reporting option. You can choose whether or not you would like to send error reports to Microsoft. Just click on next.

  15. At this point, SQL server will install on your computer. This could take a while to complete depending on the computer you are using.

    SQL Server 2012 Express installation progress bar

  16. Once the installation has completed, you will receive a screen showing the details of what was completed and if there were any problems.

    Installation Complete page with installed features highlighted

 

Popular Links

Looking for more information on MSSQL? Search our Knowledge Base!

Interested in more articles about Databases? Navigate to our Categories page using the bar on the left or check out these popular articles:

Popular tags within this category include: MySQL, MSSQL, phpMyAdmin, PostgreSQL, and more.

Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.

 

The Hivelocity Difference

Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.

With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.

Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.

The post How to install SQL Server 2012 Express on Windows server 2012 appeared first on Hivelocity Hosting.

]]>
How to install SQL Server Management Studio 2012 on Windows Server 2012 https://www.hivelocity.net/kb/how-to-install-sql-server-management-studio-2012-on-windows-server-2012/ Thu, 27 Aug 2015 20:15:30 +0000 https://www.hivelocity.net/?post_type=hv_knowledgebase&p=11926 Installing SQL Server Management Studio 2012 This tutorial will help you install SQL Server Management Studio 2012 (SSMS) on your Windows server. By following these 11 easy steps, you’ll be ready to use SSMS in no time. First, log in to your windows server with administrator user. Download the setup for SQL Server Management Studio …

How to install SQL Server Management Studio 2012 on Windows Server 2012 Read More »

The post How to install SQL Server Management Studio 2012 on Windows Server 2012 appeared first on Hivelocity Hosting.

]]>
Installing SQL Server Management Studio 2012

This tutorial will help you install SQL Server Management Studio 2012 (SSMS) on your Windows server. By following these 11 easy steps, you’ll be ready to use SSMS in no time.

  1. First, log in to your windows server with administrator user.
  2. Download the setup for SQL Server Management Studio depending on your server type (x64, x86). https://www.microsoft.com/en-us/download
  3. Once you download the setup file , double click on it in order to start the installation.

    Window showing the file extraction progress bar

  4. The setup will start with primary installation screen of SQL Server , click on New SQL Server stand-alone installation or add features to an existing installation.

    SQL Server Installation Center window with "New SQL Server installation" highlighted

  5. On the next screen, you will see that SQL setup is checking for the product update. Let the process finish. If there are updates the screen will show them. Otherwise, once checking is complete, click Next.

    Window showing SQL Server 2012 updates progress bar

  6. On the next screen the setup will prepare for the installation.

    Window showing SQL Server 2012 setup files installation progress bar

  7. On the next screen, select the SQL server instance that’s installed on the server. Select the option to Add features to an existing instance of SQL server 2012. The installation will take the default SQL server instance that is already installed on the server so no need to make any changes with it. Click on Next.

    Window highlighting the SQLEXPRESS installation option

  8. On the feature selection screen, select all the available options under Features window and then click on Next.

    Window showing available feature options with Management Tools and LocalDB highlighted

  9. The next screen gives you options for error reporting . You can either enable the option to send error reports to Microsoft or leave it default. When you’re finished, click Next.

    Error Reporting options on SQL Server Management Studio 2012

  10. On the next screen you can see that the setup has started the installation. Wait till the installation completes.

    SQL Server Management Studio 2012 Installation Progress bar

  11. Success! When you’re installation has completed, you’ll be taken to the completion screen where you’ll see the status of the features you’ve installed.

    SQL Server 2012 Completion screen with Management Tools and LocalDB highlighted

And now you’ve successfully installed SQL Server Management Studio 2012!

 

Popular Links

Looking for more information on MSSQL? Search our Knowledge Base!

Interested in more articles about Databases? Navigate to our Categories page using the bar on the left or check out these popular articles:

Popular tags within this category include: MySQL, MSSQL, phpMyAdmin, PostgreSQL, and more.

Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.

 

The Hivelocity Difference

Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.

With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.

Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.

The post How to install SQL Server Management Studio 2012 on Windows Server 2012 appeared first on Hivelocity Hosting.

]]>
Change ownership of a table through MS SQL https://www.hivelocity.net/kb/change-ownership-of-a-table-through-ms-sql/ https://www.hivelocity.net/kb/change-ownership-of-a-table-through-ms-sql/#respond Sat, 18 Dec 2010 06:55:35 +0000 https://kb.hivelocity.net/?p=2402 DECLARE @old sysname, @new sysname, @sql varchar(1000) SELECT @old = 'oldOwner_CHANGE_THIS' , @new = 'dbo' , @sql = ' IF EXISTS (SELECT NULL FROM INFORMATION_SCHEMA.TABLES WHERE QUOTENAME(TABLE_SCHEMA)+''.''+QUOTENAME(TABLE_NAME) = ''?'' AND TABLE_SCHEMA = ''' + @old + ''' ) EXECUTE sp_changeobjectowner ''?'', ''' + @new + '''' EXECUTE sp_MSforeachtable @sql —– The same can be done …

Change ownership of a table through MS SQL Read More »

The post Change ownership of a table through MS SQL appeared first on Hivelocity Hosting.

]]>
DECLARE @old sysname, @new sysname, @sql varchar(1000) SELECT @old = 'oldOwner_CHANGE_THIS' , @new = 'dbo' , @sql = ' IF EXISTS (SELECT NULL FROM INFORMATION_SCHEMA.TABLES WHERE QUOTENAME(TABLE_SCHEMA)+''.''+QUOTENAME(TABLE_NAME) = ''?'' AND TABLE_SCHEMA = ''' + @old + ''' ) EXECUTE sp_changeobjectowner ''?'', ''' + @new + '''' EXECUTE sp_MSforeachtable @sql

—– The same can be done to stored procedures: —–

DECLARE @oldOwner sysname, @newOwner sysname SELECT @oldOwner = 'oldOwner_CHANGE_THIS' , @newOwner = 'dbo' select 'EXECUTE sp_changeobjectowner '''+QUOTENAME(a.SPECIFIC_SCHEMA)+'.'+QUOTENAME(a.ROUTINE_NAME)+''','''+@newOwner+'''' from INFORMATION_SCHEMA.ROUTINES a where a.ROUTINE_TYPE = 'PROCEDURE' AND a.SPECIFIC_SCHEMA = @oldOwner AND OBJECTPROPERTY(OBJECT_ID(QUOTENAME(a.SPECIFIC_SCHEMA)+'.'+QUOTENAME(a.ROUTINE_NAME)), 'IsMSShipped') = 0 DECLARE @old sysname, @new sysname, @sql varchar(1000) SELECT @old = 'oldOwner' , @new = 'dbo' , @sql = ' IF EXISTS (SELECT NULL FROM information_schema.routines WHERE QUOTENAME(ROUTINE_SCHEMA)+''.''+QUOTENAME(ROUTINE_NAME) = ''?'' AND ROUTINE_SCHEMA = ''' + @old + ''' ) EXECUTE sp_changeobjectowner ''?'', ''' + @new + '''' EXECUTE sp_MSforeachtable @sql

The post Change ownership of a table through MS SQL appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/change-ownership-of-a-table-through-ms-sql/feed/ 0
Write a stored procedure for MS SQL https://www.hivelocity.net/kb/write-a-stored-procedure-for-ms-sql/ https://www.hivelocity.net/kb/write-a-stored-procedure-for-ms-sql/#respond Sat, 18 Dec 2010 06:54:02 +0000 https://kb.hivelocity.net/?p=2401 Connect to your database through an application such as Enterprise Manager, go to your database, right click stored procedures and select new. Below is a basic example of a stored procedure: CREATE PROCEDURE spStoredPrcedureName @variable1 int, @variable2 varchar(64) AS select id from someTable where column1 = @variable1 AND column2 = @variable2 Go

The post Write a stored procedure for MS SQL appeared first on Hivelocity Hosting.

]]>
Connect to your database through an application such as Enterprise Manager, go to your database, right click stored procedures and select new. Below is a basic example of a stored procedure:

CREATE PROCEDURE spStoredPrcedureName

@variable1 int,
@variable2 varchar(64)

AS

select id from someTable where column1 = @variable1 AND column2 = @variable2

Go

The post Write a stored procedure for MS SQL appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/write-a-stored-procedure-for-ms-sql/feed/ 0
FTP through an MSSQL stored procedure https://www.hivelocity.net/kb/ftp-through-an-mssql-stored-procedure/ https://www.hivelocity.net/kb/ftp-through-an-mssql-stored-procedure/#respond Sun, 05 Dec 2010 13:31:54 +0000 https://kb.hivelocity.net/?p=865 This stored procedure takes four parameters: file to ftp server name or IP ftp login ftp password SP will ensure that local file exists before continuing, it will create and execute a batch file in order to push the file to the remote FTP server: --exec example EXEC dbo.up_FTPPushFile 'c:\temp\test.txt', 'server','user', 'password' create proc up_FTPPushFile …

FTP through an MSSQL stored procedure Read More »

The post FTP through an MSSQL stored procedure appeared first on Hivelocity Hosting.

]]>
This stored procedure takes four parameters:

  • file to ftp
  • server name or IP
  • ftp login
  • ftp password

SP will ensure that local file exists before continuing, it will create and execute a batch file in order to push the file to the remote FTP server:

--exec example

EXEC dbo.up_FTPPushFile 'c:\temp\test.txt', 'server','user', 'password'
create proc up_FTPPushFile
@file_to_push varchar(255)
@ftp_to_server varchar(255)
@ftp_login varchar(255)
@ftp_pwd varchar(255)
as
Set Nocount On

--STEP 0
--Ensure we can find the file we want to send.
Create table #FileExists (FileExists int, FileIsDir int, ParentDirExists int)

Insert #FileExists EXEC master.dbo.xp_fileexist @file_to_push
IF NOT EXISTS (SELECT * FROM #FileExists WHERE FileExists = 1)
BEGIN
Drop table #FileExists
RAISERROR ('File %s does not exist. FTP process aborted.', 16, 1, @file_to_push)
RETURN 1
END


--STEP 1
--Create xxx.bat batch file using bcp utility, file path/name is the same as @file_to_push
--batch file will hold 4 records:
--1) login
--2) password
--3) ftp command and file to push
--4) exit command

declare @sql varchar(255), @cmd varchar(255), @batch_ftp varchar(255), @ret int
set @sql = '"SELECT ftp_batch FROM ##temp_ftp_bat WHERE file_to_push = '''+ @file_to_push+'''"'
set @batch_ftp = Left(@file_to_push, Len(@file_to_push)-4) +'.bat'
set @cmd = 'BCP '+ @sql +' queryout '+ @batch_ftp +' /T /c'
Create table ##temp_ftp_bat(ftp_batch varchar(255), file_to_push varchar(255))
Insert into ##temp_ftp_bat values (@ftp_login, @file_to_push)
Insert into ##temp_ftp_bat values (@ftp_pwd, @file_to_push)
Insert into ##temp_ftp_bat values ('put '+@file_to_push, @file_to_push)
Insert into ##temp_ftp_bat values ('bye', @file_to_push)
EXEC master.dbo.xp_cmdshell @cmd
Drop table ##temp_ftp_bat


--STEP 2
--Ensure we can find the batch file we just created.

Delete #FileExists
Insert #FileExists EXEC master.dbo.xp_fileexist @batch_ftp
IF NOT EXISTS (SELECT * FROM #FileExists WHERE FileExists = 1)
BEGIN
Drop table #FileExists
RAISERROR ('Unable to create FTP batch file %s. FTP process aborted.', 16, 1, @batch_ftp)
RETURN 1
END
Drop table #FileExists


--STEP 3
--Execute newly created .bat file, save results of execution

Create table #temp_ftp_results (ftp_output varchar(255))
set @cmd = 'ftp -s:'+@batch_ftp+' '+@ftp_to_server
Insert #temp_ftp_results Exec master.dbo.xp_cmdshell @cmd
IF EXISTS (SELECT * FROM #temp_ftp_results WHERE (ftp_output like '%Login failed%' or ftp_output like '%Access is denied%'))
BEGIN
Drop table #temp_ftp_results
RAISERROR ('Unable to FTP file %s. Login failed or access denied. FTP process aborted.', 16, 1, @file_to_push)
RETURN 1
END
Drop table #temp_ftp_results


--STEP 4
--delete batch file

set @cmd = 'del '+@batch_ftp
EXEC master.dbo.xp_cmdshell @cmd
go

The post FTP through an MSSQL stored procedure appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/ftp-through-an-mssql-stored-procedure/feed/ 0
What database software does Hivelocity support? https://www.hivelocity.net/kb/what-database-software-does-hivelocity-support/ https://www.hivelocity.net/kb/what-database-software-does-hivelocity-support/#respond Sun, 14 Nov 2010 11:45:03 +0000 https://kb.hivelocity.net/?p=2518 Hivelocity supports Microsoft SQL server AKA MSSQL , PostgreSQL , and MYSQL.

The post What database software does Hivelocity support? appeared first on Hivelocity Hosting.

]]>
Hivelocity supports Microsoft SQL server AKA MSSQL , PostgreSQL , and MYSQL.

The post What database software does Hivelocity support? appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/what-database-software-does-hivelocity-support/feed/ 0
Install Microsoft SQL Server https://www.hivelocity.net/kb/install-microsoft-sql-server/ https://www.hivelocity.net/kb/install-microsoft-sql-server/#respond Sun, 14 Nov 2010 11:34:32 +0000 https://kb.hivelocity.net/?p=2425 The installation of Microsoft SQL Server, like that of various modern products is fairly easy, whether you are using a CD called SQL Server Developer Edition, a DVD or a downloaded edition. If you have it on CD or DVD, you can put it in the drive and follow the instructions on the screen as …

Install Microsoft SQL Server Read More »

The post Install Microsoft SQL Server appeared first on Hivelocity Hosting.

]]>

The installation of Microsoft SQL Server, like that of various modern products is fairly easy, whether you are using a CD called SQL Server Developer Edition, a DVD or a downloaded edition. If you have it on CD or DVD, you can put it in the drive and follow the instructions on the screen as we will review them.

The following steps describe the installation on a Microsoft Windows 2000 Server by the Administrator account, a Windows XP Home Edition, a Windows XP Professional, or the downloaded edition on a Microsoft Windows 2000 Professional.

Log on to your Windows 2000 Server or open Windows 2000/XP Professional
Put the CD or DVD in the drive or download the trial edition of SQL Server
If you are using the CD or DVD, a border-less window should come up (if it doesn’t, open Windows explorer, access the drive that has the CD or DVD and double-click autorun)
If you had downloaded the file, you may have the Download Complete dialog box
In this case, click Open. A dialog box will indicate where the file would be installed
You can accept the default and click Finish. You may be asked whether you want to create the new folder that doesn’t exist and you should click Yes. After a while, you should receive a message indicating success:
Click OK
If you are using the CD installation, click SQL Server 2000 Components or press Alt C.
If you are using the downloadable edition, locate the folder where the files were installed. You should see an autorun icon. Double-click it.
Click SQL Server Components and click Install Database Server
On the first page of the Welcome wizard, click Next
On the second page, choose the type of installation you are performing by clicking the appropriate radio button. The Remote Computer choice would lead you to select a computer or provide its path so you can install SQL Server on a computer that is not close to you. Otherwise, accept or select the Local Computer radio button
After selecting the desired type of installation and if necessary providing the information needed, click Next
The next dialog box allows you to select an installation option such as performing an installation live or scheduling that can be done without your eyewitness supervision (second radio button). For this installation, you should accept the default first radio button and click Next
The next option allows you to type your name (the name you use here has nothing to do with authentication) and optionally your company. After doing this, click Next
Read the Software License Agreement COMPLETELY and, if you agree, click Next. If you don’t agree, click No and stop the whole thing. The next steps assume that you agreed with the small prints
Next, enter the 25-digit CD-Key and click Next
The next step provides other options for the installation type. The first radio button is mainly used if you are installing on a workstation that will be connecting to a server or to servers. The third option allows you to install only MDAC. You should accept or select the default second radio button
After making your selection, click Next.
If possible, accept the Default check box selected on the wizard page.
If you must enter an Instance Name, choose a convenient name and type.
Click Next
The next steps will need some decisions from you. For example, you must now set the amount of installation you want to perform and the folder in which you want to store SQL Server. In most cases, you can accept the default Typical
Click Next
The next step allows you to specify who is doing the installation. If you are an administrator, specify the account’s password. If you have an account that can perform an installation on the server, enter its username, its password, and the domain it belongs to.
Click Next
On the next step, you can accept to exclusively use Windows Authentication with the first radio button. Otherwise, you can and should use this opportunity to allow different persons to log in to this SQL Server. In this case, you can select the second radio button and create a password for the SQL Server Authentication, which would create and setup the sa account
You should never use or allow a blank password, even if you are working alone. For one thing, this would be a bad habit you should not let get to you. For another thing, database security should be one of your biggest concerns and an employer or a job interviewer would be happy to know that you take security issues to your heart and you care. If that’s the case, specify the type of authentication you will use. You should select
Click Next
Once Setup has enough information, on the last wizard page, simply click Next
Once the installation is over, click Finish

SQL Server Startup

To use SQL Server, it must start as a service. You have two options. You can start it every time you want to use. You can also make it start whenever the computer comes up from booting.
To start SQL Server, on the Taskbar, click Start -> Programs -> Microsoft SQL Server -> Service Manager
On the SQL Server Service Manager dialog box, click the Start/Continue button if necessary
On the lower-right corner of the desktop, on the clock section of the Taskbar, the button of SQL Server appears with a green play button .
Close the dialog box

Stopping SQL Server

To stop the SQL Server service, double-click the SQL Server icon on the Taskbar system tray
On the SQL Server Service Manager dialog box, click the Stop button
You will receive a confirmation message box. Click Yes.

Starting the SQL Server Service Automatically

Display the Control Panel window and double-click Administrative Tools
In the Administrative Tools window, double-click Services
In the Services window, scroll to the middle of the right frame and click MSSQLSERVER
On the toolbar, click the Start Service button
Close the Services window

The post Install Microsoft SQL Server appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/install-microsoft-sql-server/feed/ 0
Enable the full text indexing for a MSSQL database https://www.hivelocity.net/kb/how-do-i-enable-the-full-text-indexing-for-a-mssql-database/ https://www.hivelocity.net/kb/how-do-i-enable-the-full-text-indexing-for-a-mssql-database/#respond Sun, 14 Nov 2010 11:17:45 +0000 https://kb.hivelocity.net/?p=2424 Syntax sp_fulltext_database Initializes full-text indexing or removes all full-text catalogs from the current database. sp_fulltext_database [@action =] 'action' Arguments [@action =] 'action' Is the action to be performed. action is varchar(20), and can be one of these values. enable Enables full-text indexing within the current database. Important Use carefully. If full-text catalogs already exist, this …

Enable the full text indexing for a MSSQL database Read More »

The post Enable the full text indexing for a MSSQL database appeared first on Hivelocity Hosting.

]]>
Syntax

sp_fulltext_database

Initializes full-text indexing or removes all full-text catalogs from the current database.

sp_fulltext_database [@action =] 'action'
Arguments
[@action =] 'action'

Is the action to be performed. action is varchar(20), and can be one of these values.
enable
Enables full-text indexing within the current database. Important Use carefully. If full-text catalogs already exist, this procedure drops all full-text catalogs, re-creates any full-text indexing indicated in the system tables, and marks the database as full-text enabled.This action does not cause index population to begin; an explicit start_full or start_incremental on each catalog must be issued using sp_fulltext_catalog to populate or repopulate the full-text index.

disable
Removes all full-text catalogs in the file system for the current database and marks the database as being disabled for full-text indexing. This action does not change any full-text index metadata at the full-text catalog or table level.

Return Code Values

0 (success) or 1 (failure)
Result Sets
None
Remarks

Disabling full-text indexing does not remove rows from sysfulltextcatalogs and does not indicate that full-text enabled tables are no longer marked for full-text indexing. All the full-text metadata definitions are still in the system tables. It does indicate that full-text indexing is turned off for the database and no full-text indexing activity can occur.

Permissions

Only members of the sysadmin fixed server role and db_owner fixed database role can execute sp_fulltext_database.

Examples

A. To enable a database for full-text indexing
This example enables full-text indexing for the Northwind database.
USE Northwind
EXEC sp_fulltext_database 'enable'

B. To remove all catalogs from a database
This example disables full-text indexing for the Northwind database.
USE Northwind
EXEC sp_fulltext_database 'disable'

The post Enable the full text indexing for a MSSQL database appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/how-do-i-enable-the-full-text-indexing-for-a-mssql-database/feed/ 0
Connect to my MSSQL database via Enterprise Manager? https://www.hivelocity.net/kb/how-do-i-connect-to-my-mssql-database-via-enterprise-manager/ https://www.hivelocity.net/kb/how-do-i-connect-to-my-mssql-database-via-enterprise-manager/#respond Sun, 14 Nov 2010 11:12:48 +0000 https://kb.hivelocity.net/?p=2420 To connect to your MSSQL database using Enterprise Manager, please perform the following: 1. Bring up Enterprise Manager. 2. Go to menu “Action”->”New SQL Server registration”. 3. Use IP address for Server Name – for example “113.14.15.16”. 4. Use SQL Server authentication. 5. Login name = SQL username (this will be located in your control …

Connect to my MSSQL database via Enterprise Manager? Read More »

The post Connect to my MSSQL database via Enterprise Manager? appeared first on Hivelocity Hosting.

]]>
To connect to your MSSQL database using Enterprise Manager, please perform the following:
1. Bring up Enterprise Manager.
2. Go to menu “Action”->”New SQL Server registration”.
3. Use IP address for Server Name – for example “113.14.15.16”.
4. Use SQL Server authentication.
5. Login name = SQL username (this will be located in your control panel H-sphere -> MSSQL Server).
6. Password = SQL password
Then, navigate to your database using the provided database list.

Your SQL server must also be set to use TCP/IP as the default protocol. To do so, you will need to run the Client Configuration utility that comes with MSSQL Server.

The post Connect to my MSSQL database via Enterprise Manager? appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/how-do-i-connect-to-my-mssql-database-via-enterprise-manager/feed/ 0