Forum Replies Created

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

  • 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...

  • RE: INSERT/DELETE specific records

    Buddy, small tweaks in the code will get you there!

    For this requirement,

    The SELECT statement for the INSERT should return these records:

    A,5

    C,1

    These are the records in #ListUpdate that are not in...

  • RE: Analysing a T-SQL Query

    Wonderful question and equally wonderful explanation. The basics is hit in the nail! Thanks for this!

  • RE: SQL Query

    Hey there! I have coded an below-par code for this requirement! This is what that struck my mind! Pro'ly there are many altenative super-fast , minimal-code, optimal-performance code available....

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