Viewing 15 posts - 91 through 105 (of 162 total)
As stated above, your requirements are unclear. If you are looking for MAX values, I don't see any duplicates in your data except for descriptions and codes in #TableC....
February 22, 2012 at 7:42 am
Jack Corbett (2/21/2012)
You really don't want a trigger for this. Your best bet is to add a Default constraint ...
Jack, I disagree that the best bet is...
February 22, 2012 at 7:26 am
I think of Schemas as SQL Server's version of namespaces.
February 20, 2012 at 5:02 pm
Your basic question seems to be how to get the statement in a trigger to work, so I will try to answer that.
In a trigger, you have access to two...
February 20, 2012 at 5:00 pm
This may not be the best way, but it works for my current situation. I create a procedure that lists all the columns as parameters, with "default" values (with...
February 20, 2012 at 3:39 pm
sqlfriends (2/9/2012)
will that execute one by one, could that possibley happen that...
February 9, 2012 at 8:14 pm
32 levels is not the limit, it is simply the current maximum depth. I am not using a CTE to build the recursion; the code I have now was...
February 9, 2012 at 7:15 pm
Jeff Moden (2/7/2012)
February 8, 2012 at 7:22 am
cdh-727733 (2/7/2012)
I can't do that unfortunately as this is to be driven from user searches which I can't predict.
What I am suggesting is that you create a complete hierarchy that...
February 7, 2012 at 5:28 pm
ColdCoffee (2/7/2012)
This?
DECLARE @Date1 DATE = GETDATE()-1
,@Date2 DATE = GETDATE()-29
SELECT @Date1 , @Date2
[invoice date] BETWEEN @Date1 AND @Date2
This code will not work...
February 7, 2012 at 5:18 pm
Depending on how often the products change, it may be worth putting this data into a permanent, indexed location so that it does not have to be requeried on the...
February 7, 2012 at 10:53 am
I suggest you use the NVARCHAR datatype to be consistent with the doc_family column.
You should "ALTER COLUMN" rather than "MODIFY COLUMN".
February 7, 2012 at 10:47 am
To get the the beginning of the "from" date, CAST the first expression to a DATE datatype; that will strip the time portion completely.
To get to the end of the...
February 7, 2012 at 10:45 am
I believe the problem is that you are using CHAR fields rather than VARCHAR fields. CHAR fields are always padded to the specified number of characters. Convert to...
February 7, 2012 at 10:32 am
The way I would solve that problem is to use a temp table.
Step 1: Insert all the names into a temp table that contains an IDENTITY column, sorted by the...
February 7, 2012 at 10:23 am
Viewing 15 posts - 91 through 105 (of 162 total)