Viewing 15 posts - 136 through 150 (of 210 total)
this work?
CREATE FUNCTION [dbo].[TNU_fnTop1Ethnicity] (@people_code_id varchar(10))
RETURNS VARCHAR(255)
AS
/*Returns the top ethnicity alphabetically for people who have declared
more than 1.*/
BEGIN
DECLARE @return varchar(255)
select top 1 @return = [description] from people p
join personethnicity pe
on...
May 20, 2010 at 2:17 pm
you need to modify your group by stmt
group by b.bl_no, b.laden_date,b.container_code,b.shipper_name,b.consignee_name
, case when @num = 2 then c.status end
...
May 20, 2010 at 7:08 am
You could try enforcing it through a trigger. Something like this?
SET NOCOUNT ON
GO
CREATE TABLE dbo.Sample (
PK int identity(1,1)
, Field1 varchar(50)
, Field2 varchar(50)
, Deleted bit )
GO
CREATE TRIGGER dbo.trg_Sample
ON dbo.Sample
INSTEAD OF INSERT
AS
BEGIN
IF...
May 19, 2010 at 1:16 pm
declare @Tmp table (acct_nb int, phone_nb varchar(10), phone_stat_cd char(1))
insert into @Tmp values (1, '6165276980', 'G')
insert into @Tmp values (1, '6165277722', 'B')
select x.acct_nb
, case when...
February 24, 2010 at 7:05 am
Have you checked for any long running processes that would be affecting the tempdb? We had a similar experience with the tempdb growing until it filled up the disk -...
February 12, 2010 at 11:48 am
Not sure what "unable to delete records" means. Does your statement error out or are you rolling it back before it finishes?
February 12, 2010 at 11:22 am
Thanks all for your input.
Taking Jeff's advice, and since we're already logging site activity, I'll create a script that aggregates hits and timing and then manually scan it for trends....
February 12, 2010 at 11:18 am
I agree that each consumer has different consumption needs and in the past we've mitigated this via web services and/or custom reports. As it turns out, the sales team had...
February 8, 2010 at 12:59 pm
create table #tbl ([Name] varchar(10), [Deleted] int)
insert into #tbl values ('Smith', 0)
insert into #tbl values ('Brown', 0)
insert into #tbl values ('Green', -1)
create index ix_tbl on #tbl ([Name], [Deleted])
--create index ix_tbl_1...
February 3, 2010 at 7:25 am
Something like this?
declare @tbl table (datestring varchar(10))
insert into @tbl values ('Jan-2009')
insert into @tbl values ('Feb-2009')
insert into @tbl values ('Mar-2009')
insert into @tbl values ('Feb-2010')
select datestring
from @tbl
order by cast(replace(datestring, '-', ' ')...
February 3, 2010 at 6:54 am
Digs (2/1/2010)
When is it wise to sort or unsort..
We'll frequently sort DESC on date columns for audit/historical tables - latest record first deal.
February 2, 2010 at 7:01 am
You're basically doing an inner join between <Student> and <School> on ID columns. Are IDs unique across these two tables?
January 29, 2010 at 8:17 am
Are your developers running ALTER scripts or DROP and CREATE? Seem to remember having performance issues w/ 2000 using ALTER.
January 28, 2010 at 8:35 am
What's the datatype of the column in the view definition? Might help if you post the code for the view.
January 20, 2010 at 8:15 am
Viewing 15 posts - 136 through 150 (of 210 total)