|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
The SQL Variant Types | |
I run this code on SQL Server 2019:
CREATE TABLE sqlvariantdata ( myid INT IDENTITY(1,1), mydata SQL_VARIANT ) GO INSERT dbo.sqlvariantdata (mydata) VALUES (1) INSERT dbo.sqlvariantdata (mydata) VALUES ('ABC') INSERT dbo.sqlvariantdata (mydata) VALUES (CAST('2022-11-09' AS DATE)) GO SELECT top 10 s.mydata, SQL_VARIANT_PROPERTY(s.mydata, 'BaseType') FROM dbo.sqlvariantdata AS sWhat are the values returned from the SQL_VARIANT_PROPERTY() function? | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
The External Pushdown One of the options for query options available in T-SQL is the EXTERNALPUSHDOWN option. When is this used? Answer: With Hadoop to use part of the WHERE clause in the map reduce job Explanation: This is used to help Hadoop use the WHERE clause in the map reduce jobs. Ref: Options - https://learn.microsoft.com/en-us/sql/t-sql/queries/option-clause-transact-sql?view=sql-server-ver16 |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
Db is slow - Hi SQL Gurus, One of our production database is running very slow. I checked blocking , I didn't see any blocking. Also, check for running processes and look for any waittype. I see null. How to get more insights on a running sql server for a specific databases? What all can he checked in this […] |
SQL Server 2016 - Administration |
Transaction Logs and Service Stop - Hi! If the SQL Server service is manually stopped (not task killed) does that commit transactions? Could you theoretically then take the MDF files of a database to a new server and use them to start the database up there without having to bring over the existing LDF files too? Thanks for your thoughts! |
SQL Server 2016 - Development and T-SQL |
SQL - How to get rows for a unique object which are not processed even once for - I have a scenario, wherein I want to return the Zuora Object name from my log table of MSSQL 2016. It should only return in result if it is not processed even once for the current date. For example, Account object out of 3 runs was not processed in the first, processed in the second […] |
Development - SQL Server 2014 |
SQL Scheduled Job Performance - I am currently trying to write a query that tells me when a SQL agent job ran last and also how long it took. This is my code currently with cte2 As (select j.name as 'JobName', j.job_id as 'JobID', msdb.dbo.agent_datetime(run_date, run_time) as 'RunDateTime', run_duration as 'RunDurationSeconds' From msdb.dbo.sysjobs j INNER JOIN msdb.dbo.sysjobhistory h ON j.job_id […] |
SQL Server 2019 - Administration |
How can I refine my query in a best way with optimum results (for large database - How can I refine my query in a best way with optimum results (for large database tables) ? I tried to optimize the query with same results. please see my query. I used two inner join by using the same derived tables which is fine. Our client is now experiencing the slow performance issues by […] |
SQL Server Replication - I am setting up SQL Server replication (transaction) with below steps and configuration: Configuration: 1. Publisher on Machine A 2. Distribution on Machine B 3. Subscriber on Machine C Steps: 1. Created a common sql server user with same password on both machine A and B 2. On machine B set up the distributor by […] |
SQL Server 2019 - Development |
SQL Syntax for BETWEEN any dates and specific time - hi all i want to ask how to select from any dates and spesific time id date 1 2022-01-01 00:00:00 2 2022-01-02 05:00:00 3 2022-01-03 09:00:00 i want to select from 00:00:00 - 06:00:00 how to […] |
Refinement of my query in a best way with optimum results (for large data) - How can I refine my query in a best way with optimum results (for large database tables) ? I tried to optimize the query with same results. please see my query. I used two inner join by using the same derived tables which is fine. Our client is now experiencing the slow performance issues by […] |
Float - Hi, I am having problem with generating a Float which generates a output of adding 1 every second month. Currently, I have a solution of dividing the target by 365, but then I wont get the value to change exactly when the month starts. My data consists of date, employee id and target Hope one […] |
SQL Server 2008 - General |
SQL query but bad performance - Hello, I have the below query working properly by but very slow, the sub-query is the cause of slow but I don't what is the best way to replace it. SELECT TblStyle.StyleCode,TblColor.Ename + '('+TblColor.Code+')' Color, ISNULL (TblQCDecisionStatus.Ename, 'Need Sample') Status,TblQcbrandManagerColorDecision.CreationDate, TblQcbrandManagerColorDecision.Comment, supplier.Ename Supplier, SUM( TblQCPackingList.Quantity) TotalQuantity, --Sum of all sizes quantity of the same color […] |
T-SQL (SS2K8) |
Analyzing a huge ( more than 10600 lines )stoc proc using cte - Hello commuty, Need your help, your support and proposition! I'm analysis a huge stoc proc in sql server including a list of cte , but it's very complicated to understand the differents dependencies, Are there any tools or code that help to display a list of tables used in each cte ! Or to show […] |
SQL Azure - Development |
New to Azure - which IDE tools? - I've been working as a developer within SQL Server for over 15 years now (DWH and transactional) and think it's time I added SQL Azure to my toolbelt. I've created an account, server and database etc in Azure. Which tools are commonly used in organisations for doing the actual development? I've got Azure Data Studio […] |
Azure Data Studio Intellisense Cache Notebooks vs SQL Files - Hi, I've noticed that my SQL notebooks will take a long time to refresh the intellisense compared to a .sql file. When I create a new object, no matter how many times I "Refresh Intellisense Cache", the object will not show up in intellisense until I close the notebook, reopen, reconnect, etc (and even then, […] |
Azure Data Factory |
How to copy ADF pipeline from one subscription to another and change the config - Hello, I have a pipeline which is a chain of several sprocs, activities etc... My ADF uses user assigned managed identity of the relevant subscription, let's call it ArchiveUser that accesses several Azure sql servers and azure blob storages. Pipeline in Dev Dev subscription ArchiveUser set up in dev subscription Azure sql servers in dev […] |
SSRS 2016 |
Definition of the Report is invalid when Deploying Report - I'm a little new to SSRS and I hope I can get some direction. I have a Report which consists of 4 different Subreports all in their own rectangle to facilitate page breaks (See attachment). Some of the Subreports were copied and slightly altered (new text) and some are used as is. They all run […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |