Forum Replies Created

Viewing 15 posts - 1 through 15 (of 86 total)

  • RE: Cant figure how to pull out unique values from 3 tables

    I am new to sqlserver and that's totally lost me

  • RE: Still cannot figure passing a variable to procedure

    installations could contain any column name EG Installations, installs or whatever the spreadsheet column which the user picks is called

  • RE: Still cannot figure passing a variable to procedure

    what other way round is there

  • RE: Still cannot figure passing a variable to procedure

    hi there.

    no I will not be using the internet just our local server.

    Here is my full code fyi

    USE [TestData]

    GO

    /****** Object: StoredProcedure [dbo].[totalinstallations] Script Date: 11/21/2013 09:58:29...

  • RE: Still cannot figure passing a variable to procedure

    thanks again grasshopper

    I have done that and it works perfect

    your a star much appreciated

  • RE: Still cannot figure passing a variable to procedure

    Thanks so much Grasshopper that is good.

    One problem I have introduced now is when I try to execute it with EXEC master..xp_cmdshell @sql command like so

    ALTER procedure [dbo].[totalinstallations]

  • RE: Conversion failing

    ok sort of works but that totals up everything and not the distinct columns, it still totals the duplicates, the correct total should be 149

    EG

    productnameproductversionsoftwaremanufacturertypecategoryinstallationsLicensable

    Office Proof 2010999.xMicrosoftCommercialOffice Productivity145Non Licensable

    Office Proof...

  • RE: Conversion failing

    I am even more confused now as that just returns a list of databases

  • RE: Conversion failing

    trouble is I never know what the column is going to be called as this is created from an imported spreadsheet

    also never going to be sure if the column in...

  • RE: Conversion failing

    just numeric values as far as I am aware and yes it is a nvarchar column

    productname ...

  • RE: Problem with my procedure

    Hi Lowell

    that's worked perfect thanks so much

  • RE: Problem with bcp and coalesce

    Hi again Keith

    SET @sql1 = '"SELECT @colnames =COALESCE(@colnames + '','', '''') + column_name from TestData.INFORMATION_SCHEMA.COLUMNS where TABLE_NAME=''newtable'' and column_name in (' + @importedquery1 + '); select @colnames;" queryout C:\inetpub\wwwroot\cleansed\HeadersOnly.csv...

  • RE: Problem with bcp and coalesce

    Hi Keith

    I never knew that you learn something new every day hey.

    anyway I have amended it to the following

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER OFF

    GO

    alter procedure [dbo].[extractnewheadings]

    @importedquery nvarchar(1000)

    as

    begin

    DECLARE @colnames NVARCHAR(max), @importedquery1 NVARCHAR(MAX),@sql1...

  • RE: Problem with bcp and coalesce

    I did do that as shown above and it producted

    Msg 102, Level 15, State 1, Procedure extractnewheadings, Line 10

    Incorrect syntax near 'newtable'.

    here is my amended code

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER OFF

    GO

    alter...

  • RE: Problem with bcp and coalesce

    Hi All

    ok if the variable @importedquery I pass in equals 'softwaremanufacturer,productname,productversion' then that's the only column headings I will want

    I have got this far but its still showing an "Msg...

Viewing 15 posts - 1 through 15 (of 86 total)