Viewing 15 posts - 10,621 through 10,635 (of 13,460 total)
your example was interesting!
I see how that fails, when I'd obviously think that was jsut fine...That's what you mean about having to test the business condition in the trigger instead,...
Lowell
August 14, 2009 at 10:40 am
I saw mine jump up; thanks!
I got promoted as a result and I'm in the "Hall of Fame" now. only 17,000 more posts and I can be like
Steve Jones...
Lowell
August 14, 2009 at 10:24 am
here's a simple example I whipped up to show the table constraint preventing more than three items checked out per student id:
Create Table tblStudent (
StudentID int identity(1,1)...
Lowell
August 14, 2009 at 10:18 am
David Portas (8/14/2009)[hr
SQL Server unfortunately has quite poor support for referential integrity and other declarative constraints in the database. Such rules often have to be implemented in procedural code either...
Lowell
August 14, 2009 at 9:55 am
recursive triggers is a per-database option; it is usually rare that you really need to call a trigger recursively, so it's disabled by default.
right click...properties for the database in quesiton...Options...

Lowell
August 14, 2009 at 9:28 am
another thing you can try to change is this:
WHERE searchstring like '%@search1%' AND searchstring like '%@search2%' searchstring like '%@search3%'...
if you search for LIKE '%something%' , then it requires a...
Lowell
August 14, 2009 at 9:02 am
ok i know i have SQL Express with Advanced Options instealled...i certainly have the options i was describing: some i've turned off, some are turned on...you can decide which to...
Lowell
August 14, 2009 at 8:56 am
thanks!
i think the script is pretty kewl, but there's so many ways to skin a cat...you can do the same in SMO and stuff, so not too many people want...
Lowell
August 14, 2009 at 8:50 am
pretty sure the SSMS can do this for you; it's just some check marks int he scripting options to include triggers, constriants, etc.(TOOLS>>Options>>Scripting>> section for TABLE...check/uncheck various scripting options)
i contributed...
Lowell
August 14, 2009 at 8:20 am
you cannot reuse the numbers if there are gaps...at least not easily.
assuming you want a 10 digit number, ie 1 with 9 preceeeding zeros:
'0000000001'
Alter Table MyTable Add MyCalculatedColumn As RIGHT('0000000000'...
Lowell
August 14, 2009 at 8:13 am
Sarab is right, it's already a built in option:

Lowell
August 14, 2009 at 6:42 am
here's how I doing: bulk insert with dynamic SQL:
note the forum strips out the slash -n, so i put a placeholder {slash-n}
--bulk insert won't take a variable name, so make...
Lowell
August 14, 2009 at 6:21 am
something like this: testing if any child data exists?
IF NOT EXISTS
( SELECT 1 FROM CHILDTABLE1 WHERE PK IN (SELECT...
Lowell
August 13, 2009 at 12:19 pm
doh thanks Matt; I did flub that up to get more than 15 instead of less than 15.
Lowell
August 13, 2009 at 11:30 am
you'll want to compare that column against the current datetime, which you get from the built in GETDATE() function.
you also want to use the DATEDIFF function to return minutes():
ie:
SELECT *...
Lowell
August 13, 2009 at 10:33 am
Viewing 15 posts - 10,621 through 10,635 (of 13,460 total)