Viewing 15 posts - 211 through 225 (of 424 total)
Impressive how you use dynamic sql exec() function to have tsql resolve expressions within parentheses. It looks like your work was mainly in finding the innermost parentheses and working...
September 15, 2015 at 1:36 pm
Maybe create a database with a few synonyms and run the sql statements. You'll get failures until you have added synonyms for all references.
August 31, 2015 at 8:15 am
mar.ko (8/18/2015)
INSERT INTO @TESTTAB SELECT * FROM dbo.UTIL_TABLE_FROM_STRING(@szDelimit)
Note....The stored function returns a table.
Why doesn't this work ?:
SET @TESTTAB = (SELECT...
August 24, 2015 at 1:41 pm
My replacer function above is fairly generic and you could probably make it more so. Without going to dynamic sql you're pretty limited. Sql Server doesn't have a...
August 18, 2015 at 12:55 pm
Are you looking for something like this?
IF EXISTS
(
SELECT *
FROM sys.objects
WHERE name = 'Replacer'
AND type in (N'FN', N'IF', N'TF')
AND objects.schema_id = SCHEMA_ID('dbo')
)
DROP FUNCTION dbo.Replacer
GO
CREATE FUNCTION Replacer
(
@Template varchar(max),
@Find1 varchar(10),
@Replace1 varchar(100),
@Find2...
August 18, 2015 at 12:41 pm
Find a host with lots of cheap disk and restore there, and shrink, and backup to get a good bak file.
Check the autogrowth settings while you're at it. I've...
August 17, 2015 at 2:19 pm
There are plenty of situations where GO is required. Some CREATE/ALTER/DROP statements must be the first in the batch. And the word "EXEC" is optional for the first...
August 6, 2015 at 5:02 pm
A neat feature of GO is that you can specify a number after it and SSMS will run the batch of statements that many times:
delete top (10) from mytable;
GO 25
One...
August 6, 2015 at 12:48 pm
I think a much faster algorithm would be to select a few identifying columns for the duplicate row and the binary_checksum(*) and group by those few columns having count(*) >...
July 31, 2015 at 10:19 am
If you are hiring for a programmer job the priorities should be to get a competent and emotionally stable person. I think finding someone who can drink with you...
July 29, 2015 at 8:35 am
This is for the dependent procs:
IF EXISTS
(
SELECT *
FROM sys.procedures
WHERE name = 'DropUdttDependentProcs'
AND type = N'P'
AND schema_id = SCHEMA_ID('dbo')
)
DROP PROCEDURE dbo.DropUdttDependentProcs
GO
CREATE PROCEDURE DropUdttDependentProcs
@UdttName varchar(128)
AS
DECLARE
@ProcedureName varchar(128),
@drop varchar(MAX),
@sql varchar(MAX)
;
SET @drop =...
July 24, 2015 at 12:55 pm
There is a best way to change UDTTs; unfortunately it requires a good standard operating procedure the same as for changing Tables. Database objects are intricately connected in a...
July 24, 2015 at 12:16 pm
I rely heavily on Logical file names. My customers all have their IT departments and naming conventions so I use Logical names to find instances of my databases I...
July 20, 2015 at 7:57 am
Very interesting!
A Group By on a set of columns is technically creating a Primary Key out of those so access will be faster for later steps.
I know in SS 6.5...
July 9, 2015 at 8:45 am
The largest tables in a database tend to be user "transactional" data. My rule is generally never allow deletes on these tables. So, I never create indexes on...
June 29, 2015 at 7:55 am
Viewing 15 posts - 211 through 225 (of 424 total)