Langsung ke konten utama

Postingan

Menampilkan postingan dengan label SQL SERVER

SQL Server – Update From Table with INNER JOIN

Often we may need to update a column in a table based of another column in another table. In SQL Server you can do this using UPDATE statement by joining tables together. To understand this better let’s take a look at below contrived example. USE [SqlAndMe] GO SELECT CustomerID , Name , OrderAmount FROM    dbo . Customers GO SELECT OrderID , CustomerID , Amount FROM    dbo . Orders GO Result Set: CustomerID     Name           OrderAmount 3              Curtis         NULL 4              Lanna          NULL 5              Marlin         NULL 6       ...

SQL SERVER – trouble shooting after installation

SQL SERVER – trouble shooting after installation FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) This is just a quick refresher. Make sure to bookmark this as you never know when you would need this solution. Let us check into the steps to resolve this error. 1) SQL Server should be up and running. Go to All Programs >> Microsoft SQL Server 2008 >> Configuration Tools >> SQL Server Configuration Manager >> SQL Server Services, and check if SQL Server service status is “Running”. 2) Enable TCP/IP in SQL Server Configuration When two or more SQL Servers are connected across network they do all communication using TCP/IP. The default port of SQL Server installation is 1433. This port can be changed through SQL Server Configuration Manager . TCP/IP should be enabled for SQL Server to be connected. Go to All Programs >> Microsoft SQL Server 2008 ...

MSSQL TIPS: Mengetahui "PORT NUMBER" SQL Server

Pernahkan anda setelah sukses menginstal SQL Server namun kesulitan untuk melakukan koneksi dari client (komputer lain?) Saya pernah dan itu sangat menyita waktu bahkan bisa bikin frustasi. Padahal ada trik yang mudah untuk mengetahui pada port berapakah service MSSQL berjalan setelah kita melakukan instalasi? Salah satu caranya adalah Copy atau ketikkan perintah berikut di SSMS, Execute dan lihatlah hasilnya: set nocount on DECLARE @test varchar(20), @key varchar(100) if charindex('\',@@servername,0) <>0 begin set @key = 'SOFTWARE\MICROSOFT\Microsoft SQL Server\'+@@servicename+'\MSSQLServer\Supersocketnetlib\TCP' end else begin set @key = 'SOFTWARE\MICROSOFT\MSSQLServer\MSSQLServer\Supersocketnetlib\TCP' end EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',@key=@key,@value_name='Tcpport',@value=@test OUTPUT SELECT 'Server Name: '+@@servername + ' Port Number:'+convert(varchar(10),@test)