Forum Replies Created

Viewing 15 posts - 781 through 795 (of 1,124 total)

  • RE: TOP 10 Distinct rows

    It would be hard for us to provide the best solution without knowing what you exactly want from us. Its there in your mind but not mine.

    Looking at the...

  • RE: Joins nightmare

    Well, It would have been very easy if you were using SQL 2005, otherwise what you could do is...

    1. Create a temporary table #VT with IDENTITY column

    2. Insert data from...

  • RE: Sa login

    Since I'm a developer, I don't keep much administrative stuffs with myself:hehe:

    Anyways, here is a script to retrieve server information along with current active user information.

  • RE: TOP 10 Distinct rows

    I'm glad, I could help.

  • RE: Sa login

    You can get the information about server in system tables such as sysservers, sysconfigures, sysdevices etc...

    Or just use the search at the top the page for scripts...

  • RE: combining data from same table

    Is this what you're looking?

    SELECTDISTINCT Discount

    FROM

    WHERE( DiscountMatrix = 'CIDG' and CustomerGroup = 'BENCH' )

    OR ( DiscountMatrix = 'BIDG' and DiscountGroup = 'BA' )

  • RE: Auto Generated No in SQL Stored Procedure

    Use this...

    DECLARE @Identity SMALLINT

    SET @Identity =1

    SELECT 'P' + LEFT('00000', 5 - LEN( CONVERT( VARCHAR(5), @Identity ) ) ) + CONVERT( VARCHAR(5), @Identity )

    SET @Identity =9856

    SELECT 'P' + LEFT('00000', 5 -...

  • RE: Bulk Load SQL 2005 Windows Authentication problem

    You need to create a credential of a windows account having the required privileges and then you have to map this credential to the sql server login account.

  • RE: TOP 10 Distinct rows

    Check this out...

    SELECTTOP 10 T.*

    FROM( SELECT CNO, MAX( SNO ) AS SNO FROM SomeTable GROUP BY CNO ) T

    ORDER BY SNO DESC

  • RE: Probably simple but maybe not? need help with a select statment

    Jai (12/6/2007)


    Hi,

    The best choice can be to use a dynamic sql where you can make the where class optional...

    Jai,

    I appreciate your feedback but, dynamic SQL is not always the...

  • RE: Probably simple but maybe not? need help with a select statment

    Is this what you're looking for?

    SELECTTable1.column1, Table2.column1, Table2.column2, Table3.column1, Table4.column1

    FROMTable1

    LEFT JOIN Table2 ON Table1.Column9 = Table2.Column11

    LEFT JOIN Table3 ON Table1.Column6 = Table3.Column5

    LEFT JOIN Table4 ON Table1.Column6 = Table4.Column9

    WHERETable1.Column1 = @InventoryID

    AND...

  • RE: Login locked

    ALTER LOGIN [EnterLoginHere] ENABLE

  • RE: Issues in Optimization

    Check for the performance hindering operations such as table scans, spools or bookmark/RID lookups.

  • RE: Temp Table Comparison SQL

    How about all having in a single query...

    SELECTA.*, B.*

    FROMTempTableA A

    FULL OUTER JOIN TempTableB B ON A.col1 = B.col1 AND A.col2 = B.col2 AND A.col3 = B.col3 AND A.col4 =...

  • RE: case statement within SELECT ROW_NUMBER() OVER(...)

    Although, Matt's solution do provide the results you wanted, but it uses functions in WHERE clause which can be avoided. Using functions in WHERE clauses is not always scalable...

Viewing 15 posts - 781 through 795 (of 1,124 total)