Viewing 15 posts - 46 through 60 (of 239 total)
If by key you mean unique index, then the following will work:
create table test (col1 int primary key, col2 int)
create unique index ux_test_col2 on test(col2)
June 14, 2006 at 8:19 am
Its a builtin feature of SQL 2005
June 1, 2006 at 12:34 pm
First, add some indexes.
Second, a SELCT will create a SHARED lock on data that it has read until the SELECT is complete. This will block writers so it is possible to...
June 1, 2006 at 12:29 pm
Also, check the definition of the views. I've worked on systems with views nesting views many levels deep, with each level using the same tables, causing them to appear in the...
June 1, 2006 at 12:22 pm
16 is fine (ANSI_PADDING ON). They just have to be the same.
June 1, 2006 at 12:14 pm
Try this.
SELECT [columns]
FROM FinCenPersonal
INNER JOIN Checks
ON Checks.Payee like '%' + FinCenPersonal.last_name + '%'
OR Checks.PurchasedBy like '%' + FinCenPersonal.last_name + '%'
[follow pattern]
Given a payee of 'Chuck Snyder', this...
June 1, 2006 at 12:08 pm
Didn't even notice that. You should size the columns to some realistic size based upon the data. Normally varchar(255) is more than sufficient for names, addresses and the like.
June 1, 2006 at 10:36 am
IN doesn't do a partial match.
Try this:
declare @t1 table (code varchar(20))
insert @t1 values ('aaaa')
insert @t1 values ('bbbb')
insert @t1 values ('cccc')
declare @t2 table (newcode varchar(20))
insert @t2 values ('aaa')
insert @t2 values...
June 1, 2006 at 10:33 am
How are you getting the data from SQL to Excel?
June 1, 2006 at 10:27 am
Try using a SELECT statement
Use SELECT Col1, Col3, ... ColN instead of SELECT *
June 1, 2006 at 10:19 am
You don't need all the subselects and ins. That will perform horribly.
Try this.
SELECT FinCenPersonal.ID, FinCenPersonal.tracking_number, FinCenPersonal.last_name, FinCenPersonal.first_name, FinCenPersonal.middle_name,
FinCenPersonal.suffix, FinCenPersonal.alias_last_name, FinCenPersonal.alias_first_name, FinCenPersonal.alias_middle_name,
FinCenPersonal.alias_suffix, FinCenPersonal.number, FinCenPersonal.number_type, FinCenPersonal.dob, FinCenPersonal.street,...
June 1, 2006 at 10:14 am
Altering a column has the effect of setting ANSI_PADDING on for that column. I've experienced problems where this caused an INDEX SCAN instead of an INDEX SEEK.
Check the value...
June 1, 2006 at 10:06 am
Try something like this:
create table holiday(holiday datetime primary key)
insert holiday values ('01 Jan 2006')
insert holiday values ('25 Dec 2006')
go
--in your function add
if exists(select * from holiday where holiday = DATEADD(DD,...
June 1, 2006 at 9:58 am
I don't believe that will work. Why do you want the sum(qty) for only one itemID? Also, putting the subselect in the select statement is a bad idea because it...
June 1, 2006 at 9:48 am
Viewing 15 posts - 46 through 60 (of 239 total)