Skip to content

Tag: sql-server

Transform and group row data into columns

I’m looking for a way to combine different rows into a single row with columns. Let’s take this example table: Desired output: Please note that Data centers are not necessarily these three, they can be N different data centers that I will not know in advance. Answer With a known set of sourceDataC…

SQL INSERT INTO from multiple tables

this is my table 1: this is my table 2: and now I want a table 3 which shows me all information: I tried first to insert into table 3 only the values from table 1 and then I inserted into table 3 the values from table 2 with an inner join where Id = Id is. But all I

How to set a connection from eclipse to SQLServer?

I am trying to connect to SQL Server from eclipse and i get the following error. I mention that i verified and the SQL Server Browser is running on the host and i have no firewall active. This is the code i’ve written: Answer First thing before DB programming. Test each “step”. Before execut…

How to insert rows to value

Have table with values refl value have parametres like : I want to select all data which is in refl to another value declare @val nvarchar(4000) . Is it possible ? When I try select @val = refl from #tbl it select only last row, I want to select all rows. How do it? It must be like Answer Try