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-
Failed to insert record and return id
I have a query that returns its id after adding DO $do$ BEGIN IF (SELECT COUNT(*) = 0 FROM COMMENTS WHERE PARENT_ID = ”${this.parent_id}’) THEN UPDATE …
Mysql query for comparing price one to each other based on type
example table name | source_data | price_a | ——————————— name A | site_a | 40.00 | name A | site_b | 50.00 | name B | site_a | 30.00 | name B | site_b …
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, …
What is the difference between “repeatable read” and “snapshot isolation”
Repeatable read is defined as a higher isolation level, that in addition to the guarantees of the read committed level, it also guarantees that any data read cannot change, if the transaction …
SQL query to Rails query (Case Statement)
This is my SQL query: SELECT user_id, CASE responsible WHEN 1 THEN “true” ELSE “false” END AS responsible FROM user_departments How do I write this in rails? I tried a query as below: …
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(*) = (…
Running an insert script from multiple values
I’m trying to run a pretty simple script that does the following: Takes the id of a content module and assigns it to multiple locations So say I click the link on a content module with ID of 123, I …