Viewing 15 posts - 11,041 through 11,055 (of 15,381 total)
One thing I would recommend is that you should ALWAYS specify the length of your character data. If you don't it will assume the default length. Do you know what...
August 8, 2012 at 1:31 pm
thall 8753 (8/8/2012)
3rd -7th columns refer to tools that lots are processed through, in that order.
I need to be able to fill in the child's...
August 8, 2012 at 1:11 pm
scottichrosaviakosmos (8/8/2012)
insert into #abc
select 1,10,11,'A','B'
union
select 1,11,12,'B','C'
union
select 1,12,13,'C','D'
union
select 2,10,11,'A','B'
union
select 2,11,13,'B','D'
union
select 2,12,11,'C','A'
Output:
Insertid Cityid Parentid ...
August 8, 2012 at 1:06 pm
I took the liberty of using an online sql formatter to make this a bit easier to read:
DECLARE @DB_NAME VARCHAR(200)
DECLARE @SQL2 VARCHAR(MAX)
DECLARE DB_CUR1 CURSOR
FOR
SELECT [NAME]
FROM dbo.sysdatabases
WHERE (dbid > 4)
AND STATUS...
August 8, 2012 at 1:00 pm
joshphillips7145 (8/8/2012)
So I changed it to a Instead Of trigger and it now prevents any entries from being inserted but no error, I just cannot figure out why!!:sick:
You changed...
August 8, 2012 at 12:42 pm
You are certainly pretty close. Here is a small little bit of help for working with triggers. They can be pretty difficult to debug because you can't just run it...
August 8, 2012 at 12:21 pm
Nope no offense taken. It seems that you still have some issues getting the information you want out of your query?
August 8, 2012 at 12:12 pm
And take the suggestions for indexes with a grain of salt. The suggestions are not always good ones. You need to test actual performance before and after adding those indexes.
August 8, 2012 at 9:59 am
Luis Cazares (8/8/2012)
Sean Lange (8/8/2012)
A couple other suggestions. You should not declare @Date as varchar and turn around and force implicit conversions to datetime.
I couldn't believe that @Date was declared...
August 8, 2012 at 9:43 am
Still no ddl or sample data? Honestly how do you expect anybody to be able to decipher this from what you have posted? We can't see the tables, we don't...
August 8, 2012 at 9:35 am
Please don't start a new thread for the same topic. Please direct all replies here. http://www.sqlservercentral.com/Forums/Topic1341216-392-1.aspx
August 8, 2012 at 9:28 am
A couple other suggestions. You should not declare @Date as varchar and turn around and force implicit conversions to datetime.
DECLARE @DATE VARCHAR(25)
SET @DATE = '2012-08-01 23:59:59'
Instead declare it as the...
August 8, 2012 at 9:14 am
You still need to look closer at the inserted and deleted virtual tables.
joshphillips7145 (8/8/2012)
August 8, 2012 at 8:57 am
joshphillips7145 (8/8/2012)
Create Trigger NoDuplicatesOn TestUniqueNulls
After Insert, Update AS
Begin
IF
(Select Count(*)
From TestUniqueNulls join TestuniqueNulls
On TestUniqueNulls.NoDupName = TestUniqueNulls.noDupName) > 1
Begin
RollBack Tran
RaiseError('Duplicate value', 11, 1)
End
End
That is reasonably close. Take a look at the...
August 8, 2012 at 8:52 am
Viewing 15 posts - 11,041 through 11,055 (of 15,381 total)