I have an sql table +——+———–+———–+——–+————–+ | rowID| location | fk_Item_ID |Balance |Inventory_Date| +——+———–+———–+——–+R…
Tag: sql-server
SQL syntax alphanumeric characters, SQL Server
If I pull this ID down from my source system it looks like 9006ABCD. What would the syntax look like if I just want to return 9006 as the ID? Essentially, I don’t need the alpha characters.
SQL rotate results from wide to vertical
I would love some help with the best way to capture some column data and rotate it so I can store the column name and numeric value in a temp table. The results are a single row showing a value for …
SQL Server – OPENROWSET Server name error using parameters
I’m having trouble with this query…Any idea how to declare variables and make it visible to OPENROWSET query? DECLARE @SERVERNM VARCHAR; SET @SERVERNM = (SELECT(CAST(CONNECTIONPROPERTY(‘…
Parse a varchar column containing XML like data into row wise
i have a column in table which contain data like XML,i would like to get data in rows. My table data as- select printDataColumn from Mytable It returns value-
time and date from nvachar
Want to convert NVarchar to Time and date using update column command in sql server CREATE TABLE [dbo].[timeconvert]( [sno] [int] NULL, [Duration_Load] [nvarchar](7) NULL, [Duration] [time](7) NULL, …
Filter and keep most recent duplicate
Please help me with this one, I’m stuck and cant figure out how to write my Query. I’m working with SQL Server 2014. Table A (approx 65k ROWS) CEID = primary key CEID State Checksum 1 …
Select every rows that contains all elements of group
Column [TYPE] has A or B or C. I want to select list of names those have all A,B,C in the table. Result — dealing with count select name from tempso group by name having count(*) = (…
Combine 2 tables without primary key
I have 2 tables and wanna combine as below Table Student: Student ID | Student Name ———–+————- 100 John 101 Micheal Table Subject: Subject Name | Subject Desc –…
SQL Server : sum and multiplies on 2 tables
I need help to SUM and MULTIPLIES on join 2 tables: tb1 tb2 In tb1, I need to sum QTY and multiples SKU with PRICE without repeating same SKU (21135208, 21035621): Current query: My result is: Expected result is: Answer I believe that you could filter out duplicates by using a subquery like SELECT DISTINCT &#…