Forum Replies Created

Viewing 15 posts - 1,591 through 1,605 (of 1,923 total)

  • RE: SQL Server Aggregation Query - Help needed

    Nagesh S-432384 (5/7/2010)


    Jeff i learned more about CTE from this post

    Wow, good that you learned more abt CTE from that code. Am very happy! :blush:

    I just tried query to...

  • RE: select case Insert, Update

    clucasi (5/7/2010)


    Thanks for the solution,

    You're Welcome, clucasi! Glad that my code helped you!

    This query has to work on other tables as well ie

    Street Descriptortype 15 when id(15), Street record-Type11 when...

  • RE: SQL Server Aggregation Query - Help needed

    riyaz.mohammed (5/6/2010)


    Hi that worked great for the example i provided. If i add another requirement into the mix what would the SQL look like?

    SEQUENCE,PRODUCT,TIME,PRICE

    1,Spoon1,2010-05-05 08:30:00.000,83.50

    2,Spoon1,2010-05-05 08:31:01.000,80.00

    3,Spoon1,2010-05-05 08:32:02.000,81.00

    4,Spoon1,2010-05-05 08:33:03.000,82.00

    5,Fork1,2010-05-05 08:31:01.00,90.50

    6,Fork1,2010-05-05...

  • RE: CTE and Self Join with NULL Values

    Hi there, can you please provide us how your desired output will look like. i have actually coded a piece for you, but i want to confirm it with your...

  • RE: Export SQL Server 2005 Table to Excel 2007 using T-SQL

    Thanks for the reply, jdddd2! But i need a T-SQL code, as in Ron's example to perform my task!

    Anyways, thanks for the info!

  • RE: select case Insert, Update

    Bhuvnesh (5/6/2010)


    ColdCoffee (5/6/2010)


    NOTE: This uses the CURSOR method, and i am pretty sure there are many efficient methods to do this. And i smell the no-c.u.r.s.o.r-ever camp is just around...

  • RE: SQL Server Aggregation Query - Help needed

    Hi there, this will do the trick for you!

    First lets set up the environment to work on by providing the sample data and the DDLs

    IF OBJECT_ID('TEMPDB..#PRODUCTS') IS NOT NULL

    DROP TABLE...

  • RE: select case Insert, Update

    I don't exactly understand your requirement, but based on your CASE statement in the first post and some bits-and-pieces i understood from other posts, i have coded one query here....

  • RE: Opendatasource query with parameter not working

    Welcome, Henri!! 🙂

  • RE: Opendatasource query with parameter not working

    Try this Henri!

    DECLARE @SQLString nvarchar(500);

    DECLARE @ParmDefinition nvarchar(500);

    DECLARE @Count varchar(30);

    DECLARE @server VARCHAR(128)

    SET @server = 'dev-server'

    SET @SQLString = N'SELECT @CountOUT = count(name) FROM OPENDATASOURCE(''SQLNCLI'',

    ...

  • RE: Export SQL Server 2005 Table to Excel 2007 using T-SQL

    Oh Ron, thanks! I always had a doubt that this has something to with the ODBC drivers.And you have now confirmed it!

    Thanks for your efforts and time, Ron!

  • RE: select case Insert, Update

    This must be done in 2 phases (i mean, 2 different queries)!

    1. Find out the entries that have "I", use LEFT JOIN and insert them into your target table.

    2. For...

  • RE: How to find details of Filegroups??

    You can use this following code to get the details you asked for:

    SELECT * FROM dbo.SYSFILES F

    LEFT JOIN SYS.FILEGROUPS FG

    ON F.GROUPID = FG.DATA_SPACE_ID

    Cheers!!

  • RE: inserting Commas

    Mark-101232 (5/5/2010)


    Try this

    CREATE FUNCTION dbo.InsertCommas(@s VARCHAR(100))

    RETURNS VARCHAR(100)

    AS

    BEGIN

    SELECT @s=STUFF(@s,Number,0,',')

    FROM master.dbo.spt_values

    WHERE Number BETWEEN 2 AND LEN(@s) AND type='P'

    ORDER BY Number DESC

    RETURN @s

    END

    GO

    DECLARE @s VARCHAR(100)

    SET @s='W'

    SELECT @s,dbo.InsertCommas(@s)

    SET @s='ABWI'

    SELECT @s,dbo.InsertCommas(@s)

    SET @s='AW'

    SELECT @s,dbo.InsertCommas(@s)

    Mark, excellent solution!...

  • RE: Determining related record by nearest date

    I think i might get you what you want, but i need to see a visual representation of what your end result would be.

    Desired results in the form of something...

Viewing 15 posts - 1,591 through 1,605 (of 1,923 total)