European Windows 2019 Hosting BLOG

BLOG about Windows 2019 Hosting and SQL 2019 Hosting - Dedicated to European Windows Hosting Customer

SQL Server 2014 Hosting - HostForLIFE.eu :: Calculate Total Rows in SQL Server 2014

clock June 24, 2016 22:15 by author Anthony

In this tutorial, I will write an article about How to Calculate Total Rows Inserted per Second in SQL Server 2014. Ever expected to compute the quantity of columns embedded consistently, for each table in every database on a server? Alternately, have you ever expected to approve that all methods have quit keeping in touch with tables? These sorts of inquiries come up routinely for me. To help with this, I've composed the following script, which inspects metadata qualities utilizing sys.partitions. This system isn't as precise as running SELECT COUNT(*) FROM, however its much quicker.

Remember, since it’s just looking at row counts, its very little help on tables that have a considerable measure of update/delete  action. Yet it does what I need it to do, and I utilize it pretty frequently, so I thought I'd experience case any other individual can advantage from it as well.

/* Declare Parameters */

DECLARE @newBaseline BIT = 1 -- change to 0 when you don't want to replace the baseline, i.e. after initial run
  , @delay CHAR(8) = '00:00:30'; -- change as needed 
IF @newBaseline = 1
BEGIN
    IF OBJECT_ID('tempdb..#baseline') IS NOT NULL
        DROP TABLE #baseline; 
    CREATE TABLE #baseline
    (
         database_name  SYSNAME
       , table_name     SYSNAME
       , table_rows     BIGINT
       , captureTime    DATETIME NULL
    );
END 

IF OBJECT_ID('tempdb..#current') IS NOT NULL
    DROP TABLE #current;
 CREATE TABLE #current
(
     database_name  SYSNAME
   , table_name     SYSNAME
   , table_rows     BIGINT
   , captureTime    DATETIME NULL
); 
IF @newBaseline = 1
BEGIN
    EXECUTE sp_MSforeachdb 'USE ?;
        INSERT INTO #baseline
        SELECT DB_NAME()
            , o.name As [tableName]
            , SUM(p.[rows]) As [rowCnt]
            , GETDATE() As [captureTime]
        FROM sys.indexes As i
        JOIN sys.partitions As p
            ON i.[object_id] = p.[object_id]
           AND i.index_id  = p.index_id
        JOIN sys.objects As o
            ON i.[object_id] = o.[object_id]
        WHERE i.[type] = 1
        GROUP BY o.name;' 
    WAITFOR DELAY @delay;
END
 EXECUTE sp_MSforeachdb 'USE ?;
INSERT INTO #current
SELECT DB_NAME()
    , o.name As [tableName]
    , SUM(p.[rows]) As [rowCnt]
    , GETDATE() As [captureTime]
FROM sys.indexes As i
JOIN sys.partitions As p
    ON i.[object_id] = p.[object_id]
   AND i.index_id  = p.index_id
JOIN sys.objects As o
    ON i.[object_id] = o.[object_id]
WHERE i.[type] = 1
GROUP BY o.name;' 
SELECT  c.*
      , c.table_rows - b.table_rows AS 'new_rows'
      , DATEDIFF(second, b.captureTime, c.captureTime) AS 'time_diff'
      , (c.table_rows - b.table_rows) / DATEDIFF(second, b.captureTime, c.captureTime) AS 'rows_per_sec'
FROM #baseline AS b
JOIN #current AS c
    ON b.table_name = c.table_name
   AND b.database_name = c.database_name
ORDER BY new_rows DESC;

 

HostForLIFE.eu SQL Server 2014 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



SQL Server 2014 Hosting - HostForLIFE.eu :: Error While Saving Table in SQL Server

clock May 31, 2016 20:46 by author Anthony

That happens because sometimes it is necessary to drop and recreate a table in order to change something. This can take a while, since all data must be copied to a temp table and then re-inserted in the new table. Since SQL Server by default doesn't trust you, you need to say "OK, I know what I'm doing, now let me do my work." This problem occurs when the Prevent saving changes that require the table re-creation option is enabled, and you make one or more of the following changes to the table:

Free ASP.NET Hosting - Europe

  • You change the Allow Nulls setting for a column.
  • You reorder columns in the table.
  • You change the column data type.
  • You add a new column.

When you change a table so that you alter the metadata structure of the table, and then you save the table, the table must be re-created based on these changes. This may result in the loss of metadata and in a direct loss of data during the re-creation of the table. If you enable the Prevent saving changes that require the table re-creation option in the Designer section of the SQL Server Management Studio (SSMS) Options window, you receive the error message that is mentioned in the “Symptoms” section.

To change the Prevent saving changes that require the table re-creation option, follow these steps:

  • Open SQL Server Management Studio (SSMS).
  • On the Tools menu, click Options.
  • In the navigation pane of the Options window, click Designers.
  • Select or clear the Prevent saving changes that require the table re-creation check box, and then click OK.

Note If you disable this option, you are not warned when you save the table that the changes that you made have changed the metadata structure of the table. In this case, data loss may occur when you save the table.

Risk of turning off the “Prevent saving changes that require table re-creation” option

Although turning off this option can help you avoid re-creating a table, it can also lead to changes being lost. For example, suppose that you enable the Change Tracking feature in SQL Server to track changes to the table. When you perform an operation that causes the table to be re-created, you receive the error message that is mentioned in the “Symptoms” section. However, if you turn off this option, the existing change tracking information is deleted when the table is re-created. Therefore, we recommend that you do not work around this problem by turning off the option.

To determine whether the Change Tracking feature is enabled for a table, follow these steps:

  • In SQL Server Management Studio, locate the table in Object Explorer.
  • Right-click the table, and then click Properties.
  • In the Table Properties dialog box, click Change Tracking.

If the value of the Change Tracking item is True, this option is enabled for the table. If the value is False, this option is disabled.

When the Change Tracking feature is enabled, use Transact-SQL statements to change the metadata structure of the table.

Steps to reproduce the problem

  • In SQL Server Management Studio, create a table that contains a primary key in the Table Designer tool.
  • Right-click the database that contains this table, and then click Properties.
  • In the Database Properties dialog box, click Change Tracking.
  • Set the value of the Change Tracking item to True, and then click OK.
  • Right-click the table, and then click Properties.
  • In the Table Properties dialog box, click Change Tracking.
  • Set the value of the Change Tracking item to True, and then click OK.
  • On the Tools menu, click Options.
  • In the Options dialog box, click Designers.
  • Click to select the Prevent saving changes that require table re-creation check box, and then click OK.
  • In the Table Designer tool, change the Allow Nulls setting on an existing column.
  • Try to save the change to the table.

HostForLIFE.eu SQL Server 2014 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.



SQL Server 2014 Hosting - HostForLIFE.eu :: How to Make Stored Procedure in SQL Server 2014?

clock April 14, 2016 21:10 by author Anthony

In this tutorial I will show you Stored Procedure usage with step by step. First of All, you have good knowledge about SQL Server  after that, you will understand as well. Basically, Stored Procedure which is used in SQL Server, SQL Server is the product of Microsoft. Stored Procedure is mostly used with Insert, Update and Delete Data in Your Tables. If you make a table and insert update and delete record a records you have used insert update and delete query simply  again and again but Stored Procedure different. Stored Procedure you make a one time simply after that you don’t use long insert update and delete query. Stored Procedure is very helpful to make a Web Application or Desktop Application with the help of ASP.NET.

How to Make a Stored Procedure

First of All, you make a table, for example, I have made a Table namely Employee and I have inserted five columns ID_Number, Name_in_Full, Designation and Salary in my table you are see below with query and screenshot.
Make a Table in SQL Server
create table employee
(
ID_Number int primary key identity(1,1),
Name_in_Full varchar(50),
Employee_Number varchar(50),
Designation varchar(50),
Salary int
)


Create-a-Table-in-SQL-Server

I have made a table  with you can see table query and display screen shot, after that I have inserted data in a table.
Insert into employee values
(‘Asif Ali’, ‘5050’, ‘Web Developer’, 250000),
(‘Aamir Ali’, ‘5051’, ‘Businessman’, 250000),
(‘Asadullah’, ‘5052’, ‘Network Engineer’, 150000),
(‘Sameer Ali’, ‘5053’, ‘Accountant’, 450000)

I have made the table and insert a record in the table.


Create Stored Procedure in SQL Server

 

I have made a Stored Procedure namely CreateProc and I have used same column name with I have already used in a table below you can see complete query and screenshot. 

create procedure createProc
(@Name_in_Full varchar(50),
@Employee_Number varchar(50),
@Designation varchar(50),
@Salary int)
as
begin
insert into employee values(@Name_in_Full, @Employee_Number, @Designation, @Salary)
end


After that I have made complete Stored Procedure after that I have inserted a data in Table via Stored Procedure, complete query and screen shot as below.

execute createProc ‘Sadam’, ‘50504’, ‘Chemical Engineer’, 25000

Afer Run above query my data is inserted in my table with the help of SP


Alter Stored Procedure in SQL Server

After that I have changed with column data type I have used with Alter Query and change my column DataType, the complete query, and screen shot as below.

alter procedure createProc(@Name_in_Full varchar(50),@Employee_Number nvarchar(50),
@Designation varchar(50),@Salary int)
as
begin
insert into employee values(@Name_in_Full, @Employee_Number, @Designation, @Salary)
end

Alter Stored Procedure in SQL Server

After that, I have made UpdateProcedure which is used with an update a record with your table with the help of SP, the query and screenshot as below.

Update Stored Procedure in SQL Server

create procedure updateProc
(@ID_Number int,
@Name_in_Full varchar(50),
@Employee_Number nvarchar(50),
@Designation varchar(50),
@Salary int)
as
begin
update employee set Name_in_Full=@Name_in_Full,
Employee_Number=@Employee_Number,
Designation=@Designation, Salary=@Salary where ID_Number=@ID_Number
end

After that, I have update a Record with Table with the help of SP, the complete query, and screenshot as below.

exec updateProc 5, ‘Sadam Hussain’, ‘50504’, ‘Chemical Engineer’, 250000

 

HostForLIFE.eu SQL Server 2014 Hosting
HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLIFE's customers. They
offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.



SQL Server 2014 Hosting - HostForLIFE.eu :: How to Optimize Tempdb Performance?

clock April 6, 2016 20:14 by author Anthony

In this tutorial, I will explain optimize tempdb performance. Tempdb is re-created every time SQL Server is started so that the system always starts with a clean copy of the database. Temporary tables and stored procedures are dropped automatically on disconnect, and no connections are active when the system is shut down.

But before we start, there are things you should know :

  • If your SQL Server instance doesn’t employ many of the activities just described, then tempdb performance may not be an issue for you.
  • On the other hand, if your SQL Server instance uses many of these features, then tempdb could become a significant bottleneck for your SQL Server instance.
  • Only by investigation will you know.
  • Keep in mind that there is only one tempdb, and it is possible for one misbehaved application and database to indirectly affect the performance of all the other databaseson the same instance.

Tempdb Internals

  • Tempdb is dropped and recreated every time the SQL Server service is stopped and restarted.
  • When SQL Server is restarted, tempdb inherits many of the characteristics of model, and creates an MDF file of 8MB and an LDF file of 1MB.
  • Autogrowth is set to grow by 10% with unrestricted growth.
  • Each SQL Server instance may have only one tempdb, although tempdb may have multiple physical files.
  • Tempdb often doesn’t act like other databases
  • Tempdb only uses the simple recovery model.
  • Many database options can’t be changed (e.g. Database Read-Only, Auto Close, Auto Shrink).
  • Tempdb may not be dropped, detached, or attached.
  • Tempdb may not be backed up, restored, be mirrored, have database snapshots made of it, or have many DBCC commands run against it.
  • Tempdb logging works differently from regular logging. Operations are only minimally logged with enough information to roll back transactions, but not to be rolled forward. The log is truncated constantly, although it can grow with long-running transactions.

Execution Plans and tempdb

  • When a query execution plan is cached, the tempdb work tables required by the plan, if any, are often cached.
  • When a work table is cached, the table is truncated (from the previous execution of the code) and up to nine pages remain in the cache for reuse.
  • This improves the performance of the next execution of the query.
  • If the system is low on memory, the Database Engine removes the execution plan and drops the associated work tables.

Types of tempdb Problems

Generally, there are three major problems you run into with tempdb:

  • Tempdb is experiencing an I/O bottleneck, hurting server performance.
  • Tempdb is experiencing DDL and/or allocation contention on various global allocation structures (metadata pages) as temporary objects are being created, populated, and dropped. E.G. Any space-changing operation (such as INSERT) acquires a latch on PFS, SGAM or GAM pages to update space allocation metadata. A large number of such operations can cause excessive waits while latches are acquired, creating a bottleneck, and hurting performance.
  • Tempdb has run out of space.

Ideally, you should be monitoring all these on a proactive basis.

Identifying tempdb I/O Problems

  • Use Performance Monitor to determine how busy the disk is where your tempdb MDF and LDF files are located.
  • LogicalDisk Object: Avg. Disk Sec/Read: The average time, in seconds, of a read of data from disk. Numbers below are a general guide only and may not apply to your hardware configuration.
  • Less than 10 milliseconds (ms) = very good
  • Between 10-20 ms = okay
  • Between 20-50 ms = slow, needs attention
  • Greater than 50 ms = serious IO bottleneck
  • LogicalDisk Object: Avg. Disk Sec/Write: The average time, in seconds, of a write of data to the disk. See above guidelines.
  • LogicalDisk: %Disk Time: The percentage of elapsed time that the selected disk drive is busy servicing read or write requests. A general guideline is that if this value > 50%, there is an I/O bottleneck.
  • SQL Server Database: Log Bytes Flushed/sec: The total number of log bytes flushed. A large value indicates heavy log activity in tempdb.
  • SQL Server Database: Log Flush Waits/sec: The number of commits that are waiting on log flush. Although transactions do not wait for the log to be flushed in tempdb, a high number in this performance counter indicates an I/O bottleneck on the disk associated with the log.

Identifying Contention on Allocation Structures

Use these performance counters to monitor allocation/deallocation contention in SQL Server:

  • Access Methods:Worktables Created/sec: The number of work tables created per second. Work tables are temporary objects and are used to store results for query spool, LOB variables, and cursors. This number should generally be less than 200, but can vary based on your hardware.
  • Access Methods:Workfiles Created/sec: The number of work files created per second. Work files are similar to work tables but are created by hashing operations. Work files are used to store temporary results for hash joins and hash aggregates.
  • Temp Tables Creation Rate: The number of temporary tables or variables created/sec.
  • Temp Tables For Destruction: The number of temporary tables or variables waiting to be destroyed by the cleanup system thread.

Add More RAM to Your Server

  • Depending on the operation, SQL Server tries to perform the action in the buffer cache. (e.g. sorts, CTEs)
  • If the buffer cache does not have enough available space, then the operation may have to spill to tempdb.
  • This places additional overhead on tempdb.
  • If your server is experiencing a memory bottleneck, then adding RAM can help reduce the load on tempdb.
  • On the other hand, if your server has plenty of memory, adding more won’t help tempdb performance.

How to Pre-allocate tempdb Space

Use ALTER DATABASE, or SSMS, to increase the size of the tempdb database MDF and LDF files.

    USE master;
    GO
    ALTER DATABASE tempdb
    MODIFY FILE
    (NAME = tempdev,
    SIZE = 20MB);
    GO
    ALTER DATABASE tempdb MODIFY FILE
    (NAME = templog, SIZE = 10MB)
    GO

Locate tempdb on Fast I/O Subsystem

  • Always locate tempdb on the fastest I/O subsystem you have available.
  • Prefer RAID 1 or RAID 10. RAID 5 is slow for writes and should generally be avoided for tempdb, as tempdb is often write-intensive.
  • If using a SAN, consult with a SAN engineer to ensure that tempdb won’t be affected by other disk I/O.
  • Consider SSD drives for tempdb MDF and LDF files.

How to Move tempdb

  • Determine the current location of the MDF and LDF files
  • Run the ALTER DATABASE command to move the files

Avoid Using TDE

  • SQL Server 2008 offers a new database-level encryption feature called Transparent Database Encryption (TDE).
  • If this is turned on for one or more databases on a SQL Server instance, then all the activity in tempdb (whether it comes from a encrypted or non-encrypted database) will be encrypted.
  • Encryption increases CPU usage and slows down tempdb performance.
  • If you decide to use TDE, you will want to incorporate as many of the tempdb performance tuning tips that I have suggested in order to help overcome the additional burden added by TDE.


HostForLIFE.eu SQL Server 2014 Hosting
HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLIFE's customers. They
offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.



SQL Server 2014 Hosting - HostForLIFE.eu :: SQL 2014 Upgrade Tips

clock April 5, 2016 18:34 by author Anthony

SQL Server Migration is a mixing process prior to SQL Server implementation newer version to a different location due to strategic decisions (such as SQL Server Consolidation). So in this article, I will explain about things to check before planning to migrate your SQL Server, from SQL Server 2008 to SQL Server 2014.

Before migrating your sql server, there are several things you need to know :

  • Your Operating System must be at least 2008. Because SQL 2014 cannot be installed on Windows 2003.
  • Your platform must be the same. It cannot go from 32 to 64 or 64 to 32.
  • The edition cannot downgrade.
  • Remember, you can only migrate from 2008.

Please note that these steps are specific for an upgrade to the database schema and data. They do not include anything regarding the upgrading or testing of an application that is going to be accessing the upgraded database. You will want to remember to test your application and not just assume it will work perfectly even after the database has been upgraded. I would also advise that you perform these steps in a non-production environment first because I often find that common sense isn’t so common after all.

  • EXECUTING DBCC

Your upgrade tasks should be to run the following statement:

DBCC CHECKDB WITH DATA_PURITY;

This will check your data for values that are no longer valid for the column datatype. For databases created prior to SQL 2005, this step is rather important to take. For databases created in SQL 2005 and later, the DATA_PURITY check is supposed to be done automatically with a regular CHECKDB.

  • EXECUTING DBCC UPDATEUSAGE COMMAND

This one has a place in any migration or upgrade process:

DBCC UPDATEUSAGE(db_name);

This command will help to fix any page count inaccuracies that are resulting in the sp_spaceused stored procedure returning wrong results. For SQL Server 2012, this check was recommended for databases created prior to SQL Server 2005. However, in SQL Server 2014, the BOL entry link lists this command as being applicable for databases created in SQL Server 2008 and later. That seems odd to me, since this command is valid for SQL Server 2005.

  • UPDATING STATISTIC

This one is a MUST for any migration or upgrade checklist:

USE db_name;
GO
EXEC sp_updatestats;

This command will update the statistics for all the tables in your database. It issues the UPDATE STATISTICS command, which warrants mentioning because you may want to use that command with the FULLSCAN option. Don’t forget to update the statistics after an upgrade. Failure to do so could result in your queries running slowly as you start your testing and may end up wasting your time while you try to troubleshoot the possible bottlenecks. With SQL Server 2014 there is also a new Cardinality Estimator (CE).

  • REFRESHING YOUR VIEWS USING SP_REFRESHVIEW

Someone will build a view that spans into another database on the same instance. And, in what may be a complete surprise to many, sometimes these views will go across a linked server as well. The point here is that your view may not be of data that is contained in just the database on that single instance. In what could be the most dramatic twist of all, sometimes these views are created using a SELECT * syntax.

When you have bad code on top of views that go to other databases, you are going to want to use sp_refreshview to refresh those views. So, if you are migrating a database in your environment to a new server then it would be a good idea to refresh your views using sp_refreshview. Most of the time it won’t do anything for you, just like a burger topped with veggie bacon. But there is that one chance where it will dramatically improve performance and your customer will be happy as a result. Using sp_refreshview is a lot like flossing: it doesn’t take much effort, and the end result is usually worth it.

  • TAKING BACKUPS

You should have taken one prior to the start of any upgrade or migration, and you had better take one right before you turn that database over to your end users. Also, you should save any output from the items listed here, as it could prove helpful should something go awry later.

  • UPGRADING YOUR HARDWARE

Microsoft lists the minimum requirements for installing SQL Server 2014. However, chances are if your servers don’t already meet those requirements then you aren’t looking to upgrade anytime soon. But if you are upgrading, then it might be time to upgrade your hardware as well. You may even consider going virtual (if you aren’t already), which will still require you to examine your hardware requirements.

  • KNOWING THE RIGHT UPGRADE PATH

If you are running SQL Server 2000 instances. You are not able to upgrade directly to SQL Server 2014 without first upgrading to an intermediary version. You have two options to choose from when going from pre-SQL Server 2005 versions. The first option is to do an upgrade in place to SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2. The second option is to do a backup (or even detach) your database and restore/attach to an instance running SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2. At that point you will be able to complete the upgrade to SQL 2014.

  • CHECK YOUR COMPATIBILITY LEVELS

If you have been going through SQL Server upgrades for the past ten years then you are likely to have noticed that the compatibility level does not get set to the newest version after the migration is complete. You need to manually set the compatibility level yourself. With SQL Server 2014 this becomes more important than in previous versions due to the new Cardinality Estimator (CE).

  • READ THE RELEASE NOTES

Take a few minutes and read the release notes. They can be useful for you to review. It’s good to have as complete a picture as possible for the new version should something not work as expected, and there are details in the release notes you may not find elsewhere.

HostForLIFE.eu SQL 2014 Hosting
HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLIFE's customers. They
offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.



SQL Server Hosting - HostForLIFE.eu :: Can Not Connect to Server on SQL Server

clock April 4, 2016 19:00 by author Anthony

Microsoft SQL Server is a relational database management system (RDBMS) products Microsoft. Primary query language is Transact-SQL is an implementation of SQL ANSI / ISO used by Microsoft and Sybase. SQL Server is generally used in the business world that has a data base of small to medium scale, but then developed with the use of SQL Server on large data bases.


Microsoft SQL Server and Sybase / ASE can communicate over the network by using a protocol TDS (Tabular Data Stream). Apart from that, Microsoft SQL Server also supports ODBC (Open Database Connectivity), and has a JDBC driver to the Java programming language. The other feature of SQL Server is the ability to create a database mirroring and clustering. In previous versions, MS SQL Server 2000 affected by the SQL Slammer computer worm which caused delays in access to the Internet on January 25, 2003.

SQL Server is the best solution of SQL that provides the capability for mission critical confidence, self-service Business Intelligence and can run on hybrid scenarios using cloud technology. SQL Server 2012 was launched with the simplification editions and licensing schemes. SQL Server is generally used in the business world that has a data base of small to medium scale, but what if at the time wanted to make turns SQL Server database can not connet to the server on the computer.

Cannot connect to XXXXXXX\SQLEXPRESS.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider).

  • Go to the "SQL Server Configuration Manager".
  • Then select the SQL Server Configuration Manager (local).
  • Then click SQL Server Services, the right side will appear.
  • Then right-click SQL Server (SQLEXPRESS) >> START. Then wait for the configuration is complete.
  • Restart Server SQL Server Management Studio.

HostForLIFE.eu SQL Hosting
HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLIFE's customers. They
offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.



SQL Server 2014 Hosting - HostForLIFE.eu :: How to Install SQL Server 2014 on Windows 10?

clock March 31, 2016 19:16 by author Anthony

Windows 10 is an operating system developed by Microsoft. Microsoft user interface 10 is designed specifically to optimize the experience based on the type of device and provided input, provide the right experience on devices teoat and at the right time. Therefore, in this article I will discuss and explain how to install SQL Server 2014 on Windows 10 operating systems.

There are several ways that can be used to install SQL Server 2014. Through the command prompt, server core, and others. But in this discussion, I will explain the easiest way, which is through SQL Server 2014 Setup wizard.

  • The first thing to do is you need to download SQL Server 2014 from Microsoft. You are free to choose for x64 or x86 according to your operating system.
  • Then double click on the .exe file has been downloaded, or to extract it. Then click the setup.exe file from folder.
  • After that it will open the SQL Server Installation Center. Select Installation, then select New SQL Server stand-alone installation or add features to an existing installation
  • After that, please check the I accept the license terms and click Next.
  • Then let SQL Server 2014 installed.
  • image

  • Then it will appear in the SQL Server 2014 Setup, Feature Selection. Select the checkboxes as shown below and click the Next button.
  • image

  • Next will appear on the SQL Server 2014 Setup, Configuration Instance. You can fill in the Name Instance in accordance with the needs and desires. In this tutorial I will be using SQLExpress. Once completed, please click the Next button.
  • image

  • Then you will see Server Configuration. selective startup type for SQL Browser as Automatic. Note that this is optional and click the Next button.
  • Then on the Database Engine Configuration, the Server Configuration tab, please select Mixed Mode (SQL Server authentication and Windows authentication). Then enter the password as well. You can also add users by clicking Add Current User. Then select Next.
  • image

  • After that you will see the installation of SQL Server 2014 when the installation has been completed.
  • Then you can click on the Start menu windows, you will find SQL Server 2014 has been installed. Please click on the SQL Server 2014 Management Studio. Then enter the server name matches the name that you created. In this tutorial I will put SQLEXPRESS on the server name. After that please click the Connect button.
  •  

HostForLIFE.eu SQL 2014 Hosting
HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLIFE's customers. They
offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.



SQL Server Hosting - HostForLIFE.eu :: How to Use Visual Studio 2010 as a SQL Server?

clock March 29, 2016 23:29 by author Anthony

In this article I will discuss about how to use Visual Studio 2010 as a SQL Server database management studio. If you want to create applications using the .NET Framework you certainly will need Microsoft Visual Studio as IDE to build your application. If you have installed SQL Server course you will need a SQL Server Management Studio as your medium to process and manipulate data.


What if you've already installed Microsoft Visual Studio but when installing Microsoft SQL Server does not install the SQL Server Management Studio?

Of course you can not query your data right, and you can only pass the command prompt. But with Microsoft Visual SQL Management Studio as the media, you can process the data in the Microsoft Visual Studio IDE

  1. Run Microsoft Visual Studio, and then open Server Explorer listed on the menu view. After that will appear Data Connection and Server.
  1. Add a data connection by clicking the right mouse button and select Add Connection. Then see the database connection will appear.
  2. Enter your name server as the instance name on your SQL Server, log into SQL by using the username and password to get access, or by using Windows authentication. Then select the database you want to use and then press the Test Connection button, and make sure that the connection to the database successfully.

  3. If the Data Connection has been filled with database structure view you have, and then query the data from the database table and by right-clicking on the Data Connection that you created and select New Query.

  4. It will display the Query Window. Then select the table you want to create the query. But not only the table that can be in the query, Views, Function and Synonims you can also query the right to suit your needs.

  5. Once you select a table, the query functioned in accordance with the display data or you can write a query that you want on the bottom. To be able to execute the query, you can click the Execute button or by pressing the F5 key

HostForLIFE.eu SQL Server Hosting

European best, cheap and reliable ASP.NET hosting with instant activation. HostForLIFE.eu is #1 Recommended Windows and ASP.NET hosting in European Continent. With 99.99% Uptime Guaranteed of Relibility, Stability and Performace. HostForLIFE.eu security team is constantly monitoring the entire network for unusual behaviour. We deliver hosting solution including Shared hosting, Cloud hosting, Reseller hosting, Dedicated Servers, and IT as Service for companies of all size.



SQL Server 2014 Hosting - HostForLIFE.eu :: How to Remove Duplicate Data From String on SQL Server?

clock March 15, 2016 21:10 by author Peter

In this tutorial, let me show you how to remove data from string in which data are separated by delimiter. An identifier that complies with all the rules for the format of identifiers can be used with or without delimiters. An identifier that does not comply with the rules for the format of regular identifiers must always be delimited.

Delimited identifiers are used in these situations:

  • When reserved words are used for object names or portions of object names.

    It is recommended that reserved keywords not be used as object names. Databases upgraded from earlier versions of Microsoft® SQL Server™ may contain identifiers that include words not reserved in the earlier version, but are reserved words for SQL Server 2000. You can refer to the object using delimited identifiers until the name can be changed.

  • When using characters not listed as qualified identifiers.

    SQL Server allows any character in the current code page to be used in a delimited identifier; however, indiscriminate use of special characters in an object name may make SQL statements and scripts difficult to read and maintain.

You can use the following code:   

CREATE FUNCTION [dbo].[DistinctList] 
    ( 
    @List VARCHAR(MAX), 
    @Delim CHAR 
    ) 
    RETURNS 
    VARCHAR(MAX) 
    AS 
    BEGIN 
    DECLARE @Return_List [varchar](max); 
    DECLARE @Temp_Str [varchar](max); 
    DECLARE @Char_index int; 
    SET @List=@List+@Delim; 
    SET @Return_List=''; 
    SET @Char_index=CHARINDEX(@Delim,@List,1); 
    WHILE @Char_index>0 
    BEGIN 
    SET @Temp_Str=SUBSTRING(@List,1,@Char_index-1); 
    SET @Return_List=@Return_List+@Temp_Str+@Delim; 
    SET @List=REPLACE(@List,@Temp_Str+@Delim,''); 
    SET @Char_index=CHARINDEX(@Delim,@List,1); 
    END 
    Return SUBSTRING(@Return_List,1 ,LEN(@Return_List)-1); 
    END  


In this function first parameter take the string  and second parameter the delimiter ,on the behalf of this delimiter we split the string and remove the duplicate data.
    DECLARE @String [varchar](max); 
    SET @String='10,11,12,10,11'; 
    SELECT dbo.DistinctList(@String,',') AS List; 


And here is the output:
10,11,12

HostForLIFE.eu SQL Server 2014 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.



How To Collect Performance Metrics From SQL Server Query Analyzer?

clock March 1, 2016 20:37 by author Peter

In this topic, I will show you how to collect value of performance counters from query analyzer. Microsoft® SQL Server SQL Query Analyzer is a graphical tool that allows you to:

  • Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
  • Quickly create commonly used database objects from predefined scripts. (Templates)
  • Quickly copy existing database objects. (Object Browser scripting feature)
  • Execute stored procedures without knowing the parameters. (Object Browser procedure execution feature)
  • Debug stored procedures. (T-SQL Debugger)
  • Debug query performance problems. (Show Execution Plan, Show Server Trace, Show Client Statistics, Index Tuning Wizard)
  • Locate objects within databases (object search feature), or view and work with objects. (Object Browser)
  • Quickly insert, update, or delete rows in a table. (Open Table window)
  • Create keyboard shortcuts for frequently used queries. (custom query shortcuts feature)
  • Add frequently used commands to the Tools menu. (customized Tools menu feature)

The following code is demo query to do same. You can create collect any counter vale for instant. Now write the code:

/*************************************************/
USE Master
GO
Create Table Perfmon (Object_name Varchar (200),
Counter_name varchar (300) , Instance_name varchar (100),
cntr_value bigint, cntr_type bigint , date varchar (20))
GO
Insert into Perfmon
SELECT object_name , counter_name , instance_name , cntr_value, cntr_type
, convert (varchar (20),getdate () , 120) as date
FROM sys.dm_os_performance_counters
WHERE OBJECT_NAME in
(
'MSSQL$Servername:Databases' ,
'MSSQL$Servername:General Statistics',
'MSSQL$Servername:Buffer Manager' ,
'MSSQL$Servername:Locks'
)
AND counter_name in
(
'Transactions/sec' ,'User Connections','Page life expectancy',
'Buffer cache hit ratio', 'Buffer cache hit ratio base' ,
'Free pages','Total pages','Target pages','Lock Wait Time (ms)'
)
Select @@servername
GO
Select *, case
when cntr_type  = 65792  Then 'instant_value'
when cntr_type = 272696576 Then 'Incremental'
When cntr_type = 1073939712 Then 'Instant fraction'
When cntr_type = 537003264 Then 'Use this with Base value'
else 'null' end 
from Master.dbo.perfmon
/*************************************************/

HostForLIFE.eu SQL Server 2014 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.



About HostForLIFE

HostForLIFE is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2019 Hosting, ASP.NET 5 Hosting, ASP.NET MVC 6 Hosting and SQL 2019 Hosting.


Month List

Tag cloud

Sign in