Viewing 15 posts - 1 through 15 (of 86 total)
I am new to sqlserver and that's totally lost me
February 3, 2014 at 7:38 pm
installations could contain any column name EG Installations, installs or whatever the spreadsheet column which the user picks is called
November 24, 2013 at 6:49 pm
what other way round is there
November 24, 2013 at 3:42 pm
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...
November 24, 2013 at 2:26 pm
thanks again grasshopper
I have done that and it works perfect
your a star much appreciated
November 21, 2013 at 10:38 pm
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]
November 21, 2013 at 10:19 pm
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...
November 20, 2013 at 5:57 pm
I am even more confused now as that just returns a list of databases
November 20, 2013 at 5:46 pm
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...
November 20, 2013 at 5:12 pm
just numeric values as far as I am aware and yes it is a nvarchar column
productname ...
November 20, 2013 at 5:07 pm
Hi Lowell
that's worked perfect thanks so much
November 18, 2013 at 3:02 pm
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...
November 14, 2013 at 7:02 pm
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...
November 14, 2013 at 4:21 pm
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...
November 14, 2013 at 3:48 pm
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...
November 13, 2013 at 10:10 pm
Viewing 15 posts - 1 through 15 (of 86 total)