Viewing 15 posts - 586 through 600 (of 7,597 total)
Liked Rune's comment.
And that is why you should always explicitly specify NOT / NOT NULL when creating a table. From the context of the q, I could work out that...
October 21, 2022 at 4:31 pm
Shrink only the file(s) that are part of the PRIMARY filegroup:
DBCC SHRINKFILE(1, 512)
DBCC SHRINKFILE(?, 512) --if you have additional file(s) in the PRIMARY fg
October 21, 2022 at 4:27 pm
SELECT CAST(SUM(OrigWeight/2000.0) AS decimal(10,2)) Tons
October 20, 2022 at 7:02 pm
SELECT OBJECT_NAME(object_id) AS object_name
SUBSTRING(definition, CHARINDEX('##', definition) - 20, 200) AS definition_first_match,
definition
FROM sys.sql_modules
WHERE definition LIKE N'%##%'
ORDER BY 1
Edit: Sorry, I...
October 20, 2022 at 6:53 pm
SQL will take only those locks needed to guarantee consistency and accuracy in results. As Jeff said, the details of that depend, but that is the general approach.
Is A an...
October 20, 2022 at 6:29 pm
Do you -- the user running the code -- also have sysadmin permission? If you have sysadmin permission, any DENYs are ignored.
October 20, 2022 at 6:27 pm
Search for '##' in the text of the proc. The only real reason that string should be in there is to reference a global temp table.
October 20, 2022 at 6:26 pm
The PARTITION SCHEME tells SQL which filegroups to use for the partitions.
October 19, 2022 at 3:56 pm
There are a number of restrictions and possible gotchas with filtered indexes. In theory they are great, in practice they can be difficult.
would you care to...
October 18, 2022 at 8:45 pm
There are a number of restrictions and possible gotchas with filtered indexes. In theory they are great, in practice they can be difficult.
would you care to explain exactly...
October 18, 2022 at 6:20 pm
There are a number of restrictions and possible gotchas with filtered indexes. In theory they are great, in practice they can be difficult.
Until you've had time to fully test out...
October 18, 2022 at 2:18 pm
Are you sure you matched the original data type and length? For example, if the original columns was varchar(8000) and you specified varchar(4000), obviously data might get truncated.
October 14, 2022 at 8:02 pm
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
GO
CREATE TRIGGER test_trg1
ON dbo.test
AFTER INSERT,UPDATE
AS
SET NOCOUNT ON;
IF UPDATE(field_key)
BEGIN
INSERT INTO dbo.audit ( name, a_date, col, old_col, new_col )
...
October 14, 2022 at 3:42 pm
I'd go with:
SELECT CONCAT(@Route, '(' + NULLIF(@USRoute, '') + ')',
CASE WHEN LEN(@Route) + LEN(@USRoute) = 0 THEN '' ELSE ', ' END,...
October 13, 2022 at 6:06 pm
I think you would have to add a GO, otherwise if the table already exists SQL Server won't be able to "compile" the SQL:
drop table if exists...
October 12, 2022 at 9:47 pm
Viewing 15 posts - 586 through 600 (of 7,597 total)