Viewing 15 posts - 49,231 through 49,245 (of 49,571 total)
Correction. TRY...CATCH only catch errors with severity>10 (anything less than that is a warning or information message and not an error) and will only catch errors that don't close the...
February 3, 2006 at 12:30 am
Ah, then you should be able to get what you want in Table3 with a single insert, no need for a seperate update after.
INSERT INTO Table3(custID, DOB_Min, DOB_Max)
SELECT Table1.CustID, MIN(Table2.DOB),...
February 2, 2006 at 5:12 am
You can do it in one step(if you had custID in table 2 that is)
Insert into Table3 (CustID, DOB_Min, DOB_Max)
SELECT CustID, MIN(C_DOB), MAX(C_DOB) FROM Table2 GROUP BY CustID
How do table1...
February 2, 2006 at 4:21 am
<sarcasm>Well excuse me for trying to help</sarcasm>
Just offerng an additional possibility that doesn't require adding an additional parameter to the procedure to deal with the output of substring.
February 2, 2006 at 4:15 am
Declare the variable as varchar.
DECLARE @v-2 VARCHAR(8000)
SELECT @v-2 = SUBSTRING(Code,@StartPos, @Length) FROM tmp_AuditTriggerCustomised
You'll get an error if you give a length over 8000 (since the variable can't hold more than 8000 characters)
The...
February 2, 2006 at 3:58 am
select ID from TBL where COL1= @a UNION select ID from TBL where COL2= @a
That will result in one index seek (first query) and one table scan (second) plus a distinct...
January 26, 2006 at 10:56 pm
In that case I will stick with my earlier advice. If this is a once-off query and in the future you will only search by ID then don't put an...
January 23, 2006 at 11:24 pm
Huh?
Statistics is a measure of the distribution of values within a column. It has nothing to do with collation.
If you want to change the collation of existing columns in existing...
January 23, 2006 at 6:16 am
So both ID and Col1 are already indexed. If this is going to be a once off query of Col2 whrn don't bother indexing it.
What's the data type of...
January 23, 2006 at 5:57 am
With an INNER JOIN I've never seen it make a difference and hence I prefer to keep the filter in the where clause. (join in the from, filter in the...
January 23, 2006 at 5:31 am
Not unless you want to risk a corrupt database.
See my first post in this thread. I noted exactly what changing the db collation changes and how to change the...
January 23, 2006 at 5:03 am
Do you ever search on ID? Is it the PK of the table (and hence uniquely indexed)
How many rows are in the table? How often is it queried? How often is...
January 23, 2006 at 4:57 am
From books online:
sp_dboption is supported for backward compatibility. Use ALTER DATABASE to set database options.
January 23, 2006 at 4:50 am
ALTER DATABASE MyDatabase COLLATE French_CI_AS
Note that this won't change the collation of existing tables. it will affect the following (from Books online)
January 23, 2006 at 4:38 am
I want to know what is happening when you make a composite index on the three columns.
What exactly do you want to know?
select ID from TBL where COL1= @a or...
January 23, 2006 at 3:34 am
Viewing 15 posts - 49,231 through 49,245 (of 49,571 total)