|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
The Time Conversion | |
On SQL Server 2022, I have this code. DECLARE @t VARCHAR(20)= '24:33:12'; SELECT TRY_CAST( @t AS TIME)What does this return? | |
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 Serverless Failover Database I have an Azure SQL Database provisioned as Serverless. When I enable a Failover group, what does this mean for the automatic options of this database? Answer: Auto-scale but not auto-pause Explanation: You still get auto-scaling with a failover group, but not auto-pause. Ref: Auto-pausing and auto-resuming - https://learn.microsoft.com/en-us/azure/azure-sql/database/serverless-tier-overview?view=azuresql#auto-pausing-and-auto-resuming |
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 2016 - Development and T-SQL |
Where clause filter view before dense rank - I have a view that has a dense rank function on a cte, sorta like this: drop view if exists drview; go create view drview AS with cte as ( select * from (values ('1', '1', 'N'), ('1', '1', 'S'), ('1', '2', 'N' )) v(field1, field2, field3) ) select * , dense_rank() over ( partition […] |
Identify mismatched pair sequences in two datasets - Hi All, I’ve got two datasets which should match pairs perfectly. There are however some pairs which have their sequences swapped around. I’d like a way to identify these mismatched pairs (swapped around). CTE? Please see the below code which replicates the issue as well as below screenshots. Thanks in advance for the help. SSQ […] |
SQL Server 2019 - Administration |
bcp out from sql table rows are breaking divided into rows two or three rows - Hi All, I am doing BCP out to text file notepad, looks like some rows are getting divided into two or multiple rows. Is there anything I need to add in the code to format it. I have comma some special characters inside the field. Ex. This test is for, dba team @, got success […] |
Request to Estimated time to apply these commands, - Good morning all I am currently working on the development of an ssrs report to supervise a transactional replication in production I used this request to retrieve the number of commands that are not delivered to the subscriber per publication IF EXISTS(SELECT * FROM sys.objects WHERE name = 'MSdistribution_history') BEGIN SELECT top(200) CONVERT(CHAR(15), time, 121) […] |
Create a Job Schedule that runs on the 1st of month only if it falls on a Sunday - This job already has one schedule that runs on the first of the month. However, we need to run the job on a different schedule if the first of the month falls on a Sunday. It appears to me that the SQL Server Agent Job Properties Scheduler GUI is not flexible enough to handle this […] |
SQL Server 2019 - Development |
Cannot alter database on Azure - Hi there We have created a database (empty) on Azure called 'Logger_Groups_CI' We then created a user called test2 as follows: -- add login CREATE LOGIN [test2] WITH PASSWORD='XXXX'; -- add user CREATE USER [test2] FROM LOGIN [test2] WITH DEFAULT_SCHEMA=dbo; then i added the user to the roles [dbmanager] and [loginmanager] as follows: -- add […] |
Passing Multiple Choices to a Stored Procedure - In my stored procedure, I have something like WHERE W.Warehouse=@WH1 It works well when it is simple as EXEC dbo.MyProcedure @WH1='S0' I need to select multiple warehouses. For example. EXEC dbo.MyProcedure @WH1='S0' OR W.Warehouse='T0' OR W.Warehouse='T0' OR W.Warehouse='Z0' I would expect that the prefix of first warehouse would be handled in the procedure so after […] |
SQL Azure - Development |
How to list sum of values in the specific period - Sorry for very newbie questions. I have a table, shown below with values about duration of events. Sometimes I have several events in one hour/day. Instead of showing each particular event, I would like ot have sum of duration of all events on hourly/daily basis. How to achieve that? SELECT * FROM [dbo].[switches] WHERE previousevent='on' […] |
SQL Azure - Administration |
Create table Partition on an existing table in synapse - I have a table in Synapse with huge volume of data and planning to create a partition by year wise with out dropping the table or data. I have seen many examples of creating a new table with partition but never came across of Alter table statements with add partition .So my question is ..is […] |
Amazon AWS and other cloud vendors |
Step functions trigger rule - Been searching online but I cannot seem to find the answer. Is it possible to run the downstream task if and only if the upstream task failed? Something similar to a trigger rule in airflow. Thank you. |
Analysis Services |
Visual studio, SSAS and stored procedure - I am trying to get data from a stored procedure into my SSAS Tabular model project. This stored procedure accepts few parameters. Is there away to supply the parameters at run time without hard coding it? |
Job Postings |
Looking for SQL Architect - My company is looking for a SQL Architect Here's a summarized version of the job posting, but you can get more details on the link below. It's a really nice company and I can totally vouch for it. About the role Major Responsibilities Be an exceptional corporate citizen. Actively contribute as a member of the […] |
SQL Server 2022 - Development |
What is the syntax for comparing a null value to another value in SQL? - To compare if a value is null in an IF condition in SQL, you can use the IS NULL operator. For example: IF myTable.custId IS NULL THEN ... END IF; This will evaluate to true if the custId column in myTable has no value. If there is a value in the custId column and you […] |
Number rows from a value in one column - Hi! I want to number rows from a value in one column (apar_id). Table Apar_id Amount 10 200 10 100 11 100 12 300 12 200 12 500 Want this result from my query Number Apar_id […] |
Joining two columns of foreign key with one column of another table - Hi, I have two columns in table1 i.e. hotel1 and hotel1 . Both of them have foreign key of second table2 hotels. i.e. Table 1 (Book) hotel1 hotel2 1 3 Table 2 Hotels 1 HotelName1 2 HotelName2 3 HotelName3 I want […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |