|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Computed Column Indexes | |
I have this definition for a computed column in my table:
ALTER TABLE dbo.Activities ADD ProdOneCount AS CASE WHEN ProductID = 1 THEN CallCount ELSE 0 END;I now want to run this code. What happens when I run this? CREATE INDEX dbo.Activities_PRodOneCountThreshold ON dbo.Activities (ProdOneCount) WHERE CallCount > 50; GO | |
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) |
Finding Failed Logins I have installed SQL Server 2017 and left the default security action for "Audit Failed Logins" in the instance security properties. Where can I view the failed logins? Answer: In the SQL Server error log and the Windows application log Explanation: The failed logins are shown in the SQL Server error log and in the Windows application log. You can view an entry in either log. |
Featured Script |
Function and Queries to Convert Hierarchical Adjacency to Nested Json Rows scdecade from SQLServerCentral This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node. The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression.
|
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 |
SSMA tool shortcomings ? - I prefer to use ssma tool to perform the database migrations from older versions of SQL server to newer versions but could see the tool has a few shortcomings like it deletes the backup files after restoring , it wont change the database owner , compatibility level of the restored databases , it wont fix […] |
SQL Server 2017 - Development |
Round at specific decimal point - Hi, I am trying to round my numbers up to the nearest whole number if the decimal is equal to or greater than .7, for example 28.7 will be 29, or round down if it is below .7, for example, 28.6 will be 28. I'm not sure If I need to truncate first and make […] |
STIntersect - A friend of mine asked me a really interesting question, and I'm a little stumped. She's trying to determine from a given flight plan, which countries a plane will fly over. I was thinking the flight plan could be described as a linestring of (long, lat) points and then I could use STIntersect to see […] |
SQL Server 2016 - Administration |
SQL Copy Database Wizard Broken - I have been using the SQL Copy Database Wizard (right click on the DB and Copy Database option) through the GUI (SMS) to copy a DB up until SQL 2016. Every installation I have where 2016 or greater has been involved the feature is broken and always gives the same error. It doesn't matter if […] |
SQL Server 2016 - Development and T-SQL |
Transaction handling in sql server - Hi All, Have some questions related to transaction management in sql server. 1. What is the difference between having SET XACT_ABORT is ON and having BEGIN TRY ... CATCH ROLLBACK; 2. What if I use only BEGIN TRY ... CATCH ROLLBACK; and do not use XACT_ABORT ON ? Any issues we need to keep in […] |
how to merge 3 different temp tables data into one - Is there any better way to do this? create table #student (StudentName varchar(20) null, StdId int not null, Stdgrade varchar(10) null) insert into #student (StudentName , StdId , Stdgrade ) select std.Name ,std.StdID ,dp.stdgrade from dbo.student std join dbo.department dp on std.stdid = dp.id where dp.isactive = 1 insert into #student (StudentName , StdId […] |
SQL Server 2012 - T-SQL |
Need help to calculate in Single Query - My table and data as follow, USE [WeightManagement] GO /****** Object: Table [dbo].[crpt_NotaPenyataKewangan_BL_Vertical_1] Script Date: 7/11/2019 10:41:39 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[crpt_NotaPenyataKewangan_BL_Vertical_1]( [idx] [int] IDENTITY(-2147483648,1) NOT NULL, [batch_Id] [uniqueidentifier] NULL, [group_1Digit] [char](5) NULL, [group_2Digit] [char](5) NULL, [group_3Digit] [char](5) NULL, [chart_code] [char](5) NULL, [pusat_kos] […] |
Find records from the last 24 hours - How do I get the records for the last 24 hours for each VisitID, based on the ActivityDateTime? So, beginning at the most recent ActivityDateTime for each VisitID, go back 24 hours and pull those records. create table #T1 ( VisitID varchar(30), IdentifierID varchar(30), ActivityDateTime datetime ) insert into #T1(VisitID,IdentifierID,ActivityDateTime) values('F0-B20191023162046527','20907277','2019-10-24 10:18:00.000') insert […] |
Get some row depending of Date of nexts rows - Hi, Sorry for my bad english. I need to select some rows of a table like that : Id Object | Start | End A | 06/11/2019 09:00 | 06/11/2019 09:15 A […] |
SQL Server 2008 - General |
sp_executesql not working - Hi, We have 2 dbs DB A and DB B on two servers AA and BB respectively linked to each other. Stored Procedure(stp) Stp_A in DB A calls stp_B in DB B fetches data from DB A and stores it in temperory table. we have used dynamic sql and used exec sp_executesql command. the sample […] |
SQL Azure - Administration |
Migrate Database with column level encryption to Azure - Hi, We've got an on-premise database that uses column level encryption and are currently investigating whether we could migrate it to the SQL Database service in Azure. In the past if we have moved the database between on-premise servers we've been able to change the master key to encrypt by password before taking a backup […] |
Reporting Services |
Hosting PowerBI in SSRS - Overview I have been tasked with the question is there a tool that can host PowerBI reports other than PowerBi Reports Engine? The problem I believe is licensing. We have license for SQL Server Enterprise 2017 that includes SSRS & SSAS. Question Can we host PowerBI Reports in SSRS? I believe I got the answer […] |
Reporting Services 2008 Development |
How to make Time Range chart in SRRS? - Hi Everyone, I am new to in SSRS report development, I have a requirement like to show the report in SSRS as below formant, Could you please help me to achieve this result? How should keep data in SQL script every five minutes what is machine status? |
TFS/Data Dude/DBPro |
TFS change tracking and details. - Hi, I had a quick question and I am using TFS 2015. How do I see what is the changeset number of an SP which is deployed just now? How do I find out at what time that Stored procedure or object was checked in? Thanks! |
Integration Services |
Dataflow each batch takes longer - I'm looking for a technical reference on how fast-load work. Each buffer transfer seems to take longer Case: Transfer data from Oracle to SQL Server Dataflow Source: Oracle Oledb, fetchsize 50000, default buffer max rows 50000 Dataflow Destination: SQL Server (fast-load), rows per batch 50000, maximum commit size 50000 The transfers start quick, but as […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |