Viewing 15 posts - 10,561 through 10,575 (of 13,461 total)
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
why can't you just replace all spaces in the string?
update yourtable set yourcolumn = replace(yourcolumn,' ','')
September 2, 2009 at 5:00 pm
maybe with row number, if we can assume there is a data entry for every date.; from the data, i'm inferring that we are getting 5 or more business days,...
September 2, 2009 at 12:59 pm
also, you don't need to expose your Id to end users.
another post a while back asked how to generate a combo varchar/number field, like AAA001 thru ZZZ999;
would something like...
September 2, 2009 at 12:32 pm
why not just seed your identity at 10,000, so they could only infer from 10,000 to 99,999;
an identity serves a much better purpose for indexing than a randome number ever...
September 2, 2009 at 12:24 pm
well finding something that is older than 5 days is easy...but you have to know which column to compare;
it took me much longer to build the CREATE TABLE and INSERT...
September 2, 2009 at 11:58 am
wierd; I've always expected that restore gives the exact same data every time...restore it and the collation, which is in the databases sys.columns is restored to wherever it was.
I haven't...
September 2, 2009 at 8:15 am
just following up;
you'll want to test this two ways; after granting permissions to the procedure, just like i showed, log into SSMS as one of those users and run the...
September 2, 2009 at 6:45 am
Here's an example of how I've done it.
First, I made sure there is a specific role created that will let people do it; mine is very simple, because a web...
September 1, 2009 at 10:56 am
Viewing 15 posts - 10,561 through 10,575 (of 13,461 total)