Viewing 15 posts - 1 through 15 (of 17 total)
Thanks for sharing. I took what you wrote and added some additional code to make it a bit more robust:
--
--
-- set @TableName before to use it
--
DECLARE @ObjectFilter VARCHAR(128), @TableName...
May 23, 2014 at 11:34 am
I can't think of a good way to produce an example of the issue I found. Just imagine that your view has more than one CTE and each CTE has...
August 29, 2013 at 11:25 am
The solution was tidy, but I'm not sure calling the referenced object a "child" of the dbobject makes much sense. Also, I found another limitation (and one I cannot offer...
August 20, 2013 at 9:03 am
I really appreciated this post. I don't think I've ever needed to do this sort of thing, but the solution was a lot cleaner than what I might have come...
August 2, 2013 at 10:15 am
Most of the time, we need to know not only the views that depend on a table, but any other object, as well. For that matter, we often want to...
July 31, 2013 at 12:57 pm
Thanks for giving me something to chew on. Another way to do this is something like this:
DECLARE @DatabaseName VARCHAR(126)
DECLARE @Object VARCHAR(126)
DECLARE @dbList TABLE(DatabaseName VARCHAR(126), QualifiedName VARCHAR(MAX))
--Enter object you are trying...
July 30, 2013 at 10:56 am
Yes. That was why I searched for the text in the OBJECT_DEFINITION().
May 30, 2013 at 11:07 am
The solution works great if you enclose the "?" within brackets and the procedure definitions are not too long. This works better for me.
DECLARE @sql nvarchar(2000);
IF OBJECT_ID('tempdb..#OPUT') IS...
May 30, 2013 at 9:35 am
How about this:
WITH CTE_missingIndexKeyOrdinal AS (
SELECT DISTINCT /* remove dups caused by composite constraints */
DB_NAME() ...
December 20, 2011 at 10:11 am
If you want to make the length and decimal places dynamic, you could do this:
DECLARE @Length int
DECLARE @Decimal int
SET @Length = 20
SET @Decimal = 5
DECLARE @Value AS FLOAT
DECLARE @IntValue AS...
November 28, 2011 at 9:50 am
Yet another approach...
DECLARE @ThisBillingPeriodDate DATE, @ThisBillingPeriodEndDate DATE, @LastBillingPeriodDate DATE, @LastBillingPeriodEndDate DATE
SET @ThisBillingPeriodDate = GETDATE();
with cte_cldr_past as (
select CAST(@ThisBillingPeriodDate as date) as cldr_dt, 0 as offset
union all
select DATEADD(day,-1,cldr_dt) as cldr_dt, offset-1...
November 22, 2011 at 3:00 pm
Didn't like the solution. There is an error in it (already noted in a previous post). Added to that, I have a method that also searches views. The extra search...
October 20, 2011 at 9:26 am
You can also do this:
SELECT LEN(REPLACE('1 ',' ','A'))
August 2, 2011 at 9:52 am
I found I needed to tweak it a bit. I needed to add an extra REVERSE() to each versionNumber element.
;WITH sampleData (appID, appVersion)
AS (SELECT 1, '10.1.55.3366'
UNION
...
July 29, 2011 at 8:54 am
I found the alternate solution offered here to be most efficient.
January 14, 2011 at 12:59 pm
Viewing 15 posts - 1 through 15 (of 17 total)