Forum Replies Created

Viewing 15 posts - 18,391 through 18,405 (of 18,923 total)

  • RE: Variable in select statement prevents use of index.

    Any here's a link on dynamic sql and why it should not be used :

    The Curse and Blessings of Dynamic SQL

    Make sure you understand the consequences on dynamic...

  • RE: Variable in select statement prevents use of index.

    I never said you couldn't change the parameter type to varchar

    .

    But I never said it would speed it up either.

  • RE: Better way??

    I was just requoting PW's solution... I never name any derived table dt (in prod environement anyways). I must say I don't apply all best practices when I just...

  • RE: Better way??

    (

    Select serverid, Max(updated) As MaxUpdated, Min(updated) As MinUpdated)

    From diskspace

    Where description = 'Local Fixed Disk'

    Group By serverid

    ) dt

    dt is short for derived table.

    I...

  • RE: Can''''t create User Defined functions!

    Doh! I can't believe I didn't think to check that. Would this be worth making a FAQ (I know it's not frequent, but the compatibility level often causes...

  • RE: Select a column .....

    Select dtQties.Part, dtQties.Qty, P.Location FROM Part_tbl P inner

    join

    (Select Part, Max(QTY) as QTY From Part_tbl group by Part) dtQties on P.Part = dtQties.Part and P.Qty = dtQties.QTY

    ORDER BY dtQties.Part, P.Location...

  • RE: concat sql more than 8kb

    I think you'll have to use an activeX script to do this in the dts... You'll be able to use a sring and won't have any length limit.

  • RE: Default parameter values

    I've never used the reporting services. But in access what you have to do is put dbo.MyStoredProc as the source of the report, then fill the inputparameters box with...

  • RE: Remi Gregoire

    Actually I must thank everyone who posted on this site. I had great teachers last year when I was learning prog, but I learned so much more from this...

  • RE: locating rows with duplicate field values

    Select key1, key2, count(*) - 1 as Dups from dbo.MyTable group by key1, key2 having count(*) > 1 order by key1, key2

  • RE: Default parameter values

    create proc dbo.SearchMyCustomers @Cust_id as int = null

    as

    set nocount on

    select * from dbo.Customers C /*may need to inner join to your list of preselected customers here*/ where C.Cust_id = @Cust_id...

  • RE: Variable in select statement prevents use of index.

    There is a thread on this forum that has been started a few days back about parameter sniffing and how sql server wasn't always utilizing the most optimized plan because...

  • RE: Can''''t create User Defined functions!

    So you're logged as SA and you still can't create objects??

    That's gonna be behond my knowledge. Good luck.

  • RE: pls suggest me with why it is so

    Can't really explain why except that it makes more sens that way... but see for yourself :

    CREATE TABLE MyTest(

    Atest varchar(50) not null,

    constraint ck_test_ATest check (ATest = '1')

    )

    GO

    CREATE TRIGGER [trMyTest_IO_Insert]...

  • RE: sql query help

    Select CustomerId, COUNT(*) as Total from dbo.CustDtl GROUP BY CustomerId

Viewing 15 posts - 18,391 through 18,405 (of 18,923 total)