Laden...
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
A Basic Data API Builder ADD | |
What parameters are required for the dab add command in the Data API Builder? | |
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) |
Removing a File I attempted to use ALTER DATABASE to remove a file from my filegroup in SQL Server 2022. There are 4 files in this filegroup, but I don't need them all. However, I received a message that the file was not empty. How do I empty this file so it can be removed? Answer: Use DBCC SHRINKFILE with the EMPTYFILE parameter Explanation: DBCC SHRINKFILE with the EMPTYFILE parameter is the best way to do this. Ref: DBCC SHRINKFILE - https://learn.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-shrinkfile-transact-sql?view=sql-server-ver16#arguments |
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 |
Question on SQL Query with NOT condition - I have a record, in those the three columns where firstname / last name and full name is empty. ID = 198765 FirstName = empty LastName = empty FullName = empty Flag = 0 I am trying to pull the record with ID 198765 out from select query where first and last or full name […] |
SQL Server 2019 - Administration |
Deadlocks and Backups - Need help - Hey everyone, please excuse my ignorance, I'm just .NET developer and have used SQL for years, but as someone pulling and manipulating data, but not much in the realm of administration or in this case troubleshooting deadlocks. I've tried to get my higher ups to get a db expert but it seems this task has […] |
Building Flame Diagram for MSSQL stored procedures - I wanted to share with you tools from my personal toolbox. If your code has many nested executions of stored procedures, you can benefit from building popular "flame diagram" of the execution time which is de facto standard for performance profiling. Here is step-by-step guide. Creation of a trace Start SQL profiler and select the […] |
SQL Server 2019 - Development |
Find Duplicate Rows - What’s the best way to find duplicate rows in a sql query? I heard there is a way where RC is used and it gives RC 1 for the first row and RC 2 for the duplicate row. But would like to know the syntax for it. I tried: select itemnumber , count (itemnumber ) […] |
Is there an ISERROR equivalent in SS? - Hi everyone I have a SP that just failed. Format of SP is: Select symbol, date, calc1, calc2 from sub-query It is due to bad data so I need to update the SP so it handles the scenario better. I am proposing the following logic: CASE WHEN "calc1 has error" THEN NULL ELSE calc1 END […] |
isnull, coalesce overhead - hi, one of our sister division's erp extract view is going thru at least one mod to do the equivalent of a coalesce on a column that if null brings down our dw load job. since they were doing that i asked if they could do the same on all columns that had never be […] |
is there an elegant way for agent notification to show failure if any step fails - hi our corp dw load sqlagent job goes to the next step on the 14+ erp loads if they fail. but quits notifying of failure on any cube step at the end. most of the loads are ssis but there is some t-sql too. without making the job really ugly, is there an elegant way […] |
Merge spans with Dates Logic - --for a given member if the startdate and endate is continous we need to keep in single record and if start date and end date is not continous i need to keep in separate record for a given member. drop table #test create table #test (ID int, startdate datetime, enddate datetime ) insert into […] |
Analysis Services |
Connect tabular model to excel via Power BI semantic model - I have a tabular cube, with myself included in one of the roles. I can connect to this tabular model via Excel successfully, and would now like to connect to a Power BI semantic model rather instead. However I get the attached error. I suspect there additional security needed to be defined, but unsure where. […] |
Administration |
Article for posting - Hello I sent you an article for posting: "Building the future with a react development company: an in-depth guide" Please reply to this email serm.nv.sakun@gmail.com regarding this article |
SQL Server 2022 - Administration |
Isolation Level in Azure SQL Database - Hello, Can you please clarify the following: In Azure SQL DB both ALLOW_SNAPSHOT_ISOLATION/READ_COMMITTED_SNAPSHOT are set to ON: ALTER DATABASE MyDatabase SET ALLOW_SNAPSHOT_ISOLATION ON ALTER DATABASE MyDatabase SET READ_COMMITTED_SNAPSHOT ON Is it sufficient to implement RCSI or I still need to add either to connection string or right to the top of the query: SET TRANSACTION ISOLATION LEVEL […] |
SQL 2022 upgrade issues - We're about to upgrade our SQL 2017 Standard to 2022 standard. We have 1 customer who takes a backup and restores it to their 2019 instance (so they can run Power BI reports). We cannot postpone it, and they have asked if we could consider a BACPAC from our new 2022 to their 2019 version. […] |
SQL Server 2022 - Development |
Remove ISNULL FROM left join to make SARGAble - Hi, I'm trying to make the below query SARGable by removing the ISNULL function part of the join. (Part of join in italic) Any suggestions? SELECT ..... FROM dbo.historicsummary hs LEFT JOIN dbo.Status fs ON hs.ID = fs.ID AND hs.TimeStamp >= fs.ValidFrom AND hs.TimeStamp < ISNULL(fs.ValidTo, DATEADD(d, 1, SYSDATETIME())) |
New lightweight pure‑T‑SQL unit‑testing framework (T‑TEST) — feedback welcome - Hi all, I’ve just open‑sourced T‑TEST, a tiny alternative to tSQLt that lives 100 % in T‑SQL—no CLR, no extra binaries. Why you might care one install.sql, < 10 KB of objects every proc in the tests schema is a test (auto‑discover by name convention) inline assertion functions (not SPs!) (test.assert_equals, test.fail, …) one-row recordset assertion (using […] |
CAST(VARCHAR(n)) resolved performance issue? - Hi, I would love to hear if anyone can tell me why a CAST in a query can "resolve" this performance issue. Same symptom on test server with a copy of the database. weblab_reportlog = 207 850 195 rows Requisitions = 30 143 466 rows DBCC FREEPROCCACHE SELECT [LID], [Datestamp], [logmessage], [Reporttype], [UserID] FROM [dbo].[weblab_reportlog] […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Laden...
Laden...
© 2025