Posts

Showing posts from June, 2018

To view all server role membership requires

SELECT sys.server_role_members.role_principal_id, role.name AS RoleName,       sys.server_role_members.member_principal_id, member.name AS MemberName  FROM sys.server_role_members  JOIN sys.server_principals AS role      ON sys.server_role_members.role_principal_id = role.principal_id  JOIN sys.server_principals AS member      ON sys.server_role_members.member_principal_id = member.principal_id;        

Determining Free Space Per SQL Server Database

SELECT DB_NAME ( database_id ) AS DatabaseName , CAST ( [Name] AS varchar ( 20 )) AS NameofFile , CAST ( physical_name AS varchar ( 100 )) AS PhysicalFile , type_desc AS FileType , (( size * 8 )/ 1024 ) AS FileSize , MaxFileSize = CASE WHEN max_size = - 1 OR max_size = 268435456 THEN 'UNLIMITED' WHEN max_size = 0 THEN 'NO_GROWTH' WHEN max_size <> - 1 OR max_size <> 0 THEN CAST ((( max_size * 8 ) / 1024 ) AS varchar ( 15 )) ELSE 'Unknown' END , SpaceRemainingMB = CASE WHEN max_size = - 1 OR max_size = 268435456 THEN 'UNLIMITED' WHEN max_size <> - 1 OR max_size = 268435456 THEN CAST (((( max_size - size ) * 8 ) / 1024 ) AS varchar ( 10 )) ELSE 'Unknown' END , Growth = CASE WHEN growth = 0 THEN 'FIXED_SIZE' WHEN growth > 0 THEN (( growth * 8 )/ 1024 ) ELSE 'Unknown' END , GrowthType = CASE WHEN is_percent_growth = 1 THEN 'PERCENTAGE'

Restore failed for Server 'Server_Name'

TITLE: Microsoft SQL Server Management Studio ------------------------------ Restore failed for Server 'Server_Name'.  (Microsoft.SqlServer.SmoExtended) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: System.Data.SqlClient.SqlError: File "DataBase_Name" cannot be restored over the existing "D:\MSSQL\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DataBase_Name.mdf". Reissue the RESTORE statement using WITH REPLACE to overwrite pre-existing files, or WITH MOVE to identify an alternate location. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&LinkId=20476 ------------------------------ BUTTONS: OK ----

VS Shell installation has failed with exit code 1638

When am try to installing SQL server 2017 on windows 64 Bit system, i am getting bellow error. TITLE: Microsoft SQL Server 2017 Release Candidate 1 (RC1) Setup ------------------------------ The following error has occurred: VS Shell installation has failed with exit code 1638. For help, click: https://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=14.0.800.90&EvtType=0x5B39C8B9%25401434%25403 ------------------------------ Solution Try to download and install VC++ 2015 manually from bellow link https://www.microsoft.com/en-us/download/details.aspx?id=48145

Connecting to the Integration Services service on the computer "ServerName" failed

Error: TITLE: Connect to Server ------------------------------ Cannot connect to ServerName. ------------------------------ ADDITIONAL INFORMATION: Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476 ----------------------------- Connecting to the Integration Services service on the computer "ServerName" failed with the following error: "The RPC server is unavailable.". This error occurs when the computer host name does not exist, or cannot be reached. For help, click: http://go.microsoft.com/fwlink/?LinkId=506689 ------------------------------ Connecting to the Integration Services service on the computer "ServerName" failed with the following error: "The RPC server is unavailable.". This error occurs when the computer host name does not exist, or cannot be reached. ------------------------------ BUTTONS: OK ---------

ole db error: ole db or odbc error: login failed for user 'nt authority\local service'.; 28000. while creating SSAS tabular model

Error : ole db error: ole db or odbc error: login failed for user 'nt authority\local service'.; 28000. while creating SSAS tabular model Solution: 1. Open SQL Server Management Studio 2. Expand the Security node, Expand Logins, if the username from the errormessage above exists in the list, right click and Properties 3. Otherwise right click Logins, "New Login..." and type in the correct Login Name as authority\local service 4. On the "User Mapping" tab check the data warehouse Map checkbox and select db_datareader and db_Owner for it 5. Click OK

try_convert is not a recognized built-in function name

Image
Error : 'try_convert' is not a recognized built-in function name               OR How to change Compatibility Level   1. For checking  Compatibility Level USE DB_Name; GO SELECT compatibility_level FROM sys.databases WHERE name = 'DB_Name';   2. Update  Compatibility Level ALTER DATABASE DB_Name    SET COMPATIBILITY_LEVEL = { 140 | 130 | 120 | 110 | 100 | 90 }