Category "sql-server"

Query to show data checkin , checkout, breakin breakout in 1 row

I have structure data like this, I'm using SQL Server: ID User_ID CheckinTime Date 1 110 "2022-03-25 06:30:29" "2022-03-25" 2 110 "2022-03-25 12:12:31" "2022-

Query to show data checkin , checkout, breakin breakout in 1 row

I have structure data like this, I'm using SQL Server: ID User_ID CheckinTime Date 1 110 "2022-03-25 06:30:29" "2022-03-25" 2 110 "2022-03-25 12:12:31" "2022-

How to insert nulls into a SQL Server table

I have the following dataframe: data = [['Alex', 182.2],['Bob', 183.2],['Clarke', 188.4], ['Kelly', NA]] df = pd.DataFrame(data, columns = ['Name', 'Height'])

Get generated keys from single insert statement with multiple values

i'm inserting multiple rows into a table using a single insert statement. The table has an auto increment field as the primary key. Like so: INSERT INTO MyTabl

Order by calculated column with alias inside case expression

I've got a problem with my order by clause when using a calculated column with an alias as below: This order by works without any problem declare @Mode int = 1

Prefered results

I am trying to list all DEPARTMENT_IDs with PRODUCT_IDs, first where PRODUCT_COST_STATUS = 1 but there are also data with where PRODUCT_COST_STATUS = 0. I prefe

Datatable with form on multipage validation issue

I have created table using datatable with in each row have td with input or select field. with having on multiple pages. The issues is the datatable render 10 r

SQL: how to convert timestamp to datetime? [closed]

I need to convert "2022-04-29T07:20:32.727Z" to "2022-04-29 07:20:32". I am quite new to SQL and haven't found the solution.

Extract data from XML document using t-sql

I have been trying to extract data from the following xml doc using t-sql on sql server 2019. XML: <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9

How to connect database to data files in Azure Blob?

This resource states that a Azure SQL database may be attached to a database by using the following command: WITH IDENTITY='SHARED ACCESS SIGNATURE', SECRET =

Decoupling Win authentification, ODCB driver authentification and SQL authentification - ODCB auth error and DLookup error

I'm trying to connect a user to my company's postgreSQL Server to access a postgres database via MS Access 2019. Connection should be established via ODCB drive

Results in ascending order with cursor

I have the following My Guitar Shop exercise in my SQL II course and am stumped with the part about getting the results in ascending order through the cursor. A

Values in Hibernate

I want a row in hibernate that only takes ("yes","no"," "), how can I map it? Something like an ENUM type in SQL but mapped in Hibernate

Can you run or debug a SQL Server stored procedure without side effects? [closed]

I would like to be able to see the effects of running a Stored Procedure that someone else has written or other SQL code on a production datab

Multiple SQL Server statements do not work on same form

I am working on a C# project with a Microsoft SQL Server database. This is how I have connected the database: DataSet ds_display = new DataSet(); SqlDataAdapte

T-SQL Check if the database contains certain tables and columns MSSQL

My goal is to continue in the procedure only with the database selected if it contains a specific table and a specific column. So that I don't get an error mess

SQL Server: UPDATE based on whether a value is greater or lesser than another value, in a single query

I'm looking to update SQL Server in a single query based on a date, however the value updated depends on whether it is greater or lower than a provided value (i

Use variable in xml path in xml.modify

Edit: SQL Server 2016. I'm running several xml.modify statements that all use pretty much the same path. I originally put an example that didn't match my err

Given a string path, find the leaf node

I am using this table and data where all children of a parent node are uniquely named. CREATE TABLE [dbo].[Resources]( [Node] [hierarchyid] NOT NULL, [N

Liquibase Formatted SQL and SQL Server Stored Procedures

My team is trying to get Liquibase-formatted SQL to work with SQL Server Enterprise. We have no problem creating tables, but whenever we try to create a stored