Viewing 15 posts - 10,561 through 10,575 (of 13,469 total)
the trigger itself looks ok, but it could still fail if any of the fields you are inserting are not null, but the data is null. That's where i...
September 6, 2009 at 2:31 pm
well, here's an example of a trigger...in this case, my trigger is keeping track of the last time a column was updated.
for trigger interview questions, I'm afraid I can't help...
September 5, 2009 at 6:35 am
ranganathanmca (9/5/2009)
i want do it on sql query analyzer only if it possible for this plz tell me what is the error and...
September 5, 2009 at 5:37 am
there's some script contributions here on SSC that call SMO; I've done this all via TSQL, where i stick a current "snapshot" of a database in a versioning table in...
September 4, 2009 at 12:54 pm
here's a similar example i did a while back; i was creating a database, and then adding roles, and then adding users, all as EXECUTE AS 'dbo'
you could picksome of...
September 4, 2009 at 11:31 am
I think this is exactly why they introduced the new EXECUTE AS command;
you don't REALLY want to give them extra rights, but they need to perform certain functions.
for #1, you...
September 4, 2009 at 11:29 am
Ahh David, yeah, i fell into that SQL trap where i assume all my PK's are also the clustered index...my bad.
September 4, 2009 at 10:25 am
Speed.
the PK determines the actual order of the data, so the any SQL's that use that "PK = somevalue" is very fast...because that PK index is used, and makes...
September 4, 2009 at 10:22 am
here's how i would do it with an CTE Tally Table:
CREATE FUNCTION StripExtraSpaces(@OriginalText VARCHAR(8000))
RETURNS VARCHAR(8000)
BEGIN
DECLARE @CleanedText VARCHAR(8000)
;WITH tally (N) as
(SELECT TOP 1000000 row_number() OVER...
September 4, 2009 at 10:13 am
Declare @myString Varchar(256)
SET @MY STRING = 'A COSMETOLOGIST uses knowledge to do things to a client`s hair. A HAIRAPIST uses knowledge to give a customer guidance...
September 4, 2009 at 10:02 am
in this case, you join the table against a copy of itself, and compare;
here i'm assuming col1 is an identity field:
the key is to compare with an offset of...
September 4, 2009 at 9:56 am
i don't get to play with permissions much, so this post intrigued me;
does db_datareader automatically bring in EXECUTE permissions on views
or db_datawriter automatically bring in EXECUTE permissions on...
September 4, 2009 at 9:34 am
i read this this morning and did not know what he was after;here's a couple of guesses:
--square root
select sqrt(81)
--is 3 a natural root of 81? if % 3 = 0...
September 3, 2009 at 10:53 am
i think only one of the two foreign keys should have the cascade options; that would resolve your circular reference issue, right?
the second column should reference, but not delete related...
September 3, 2009 at 10:29 am
you could also use a CASE inside the cursor for the evaluation:
i assume your 1=1 would actually be a real test condition;
SELECT VendorID, Name
FROM Purchasing.Vendor
WHERE PreferredVendorStatus =
CASE
WHEN MyCondition...
September 3, 2009 at 6:34 am
Viewing 15 posts - 10,561 through 10,575 (of 13,469 total)