Viewing 15 posts - 31 through 45 (of 86 total)
Hi SSCrazy
thanks for that
this now leaves me in the resultset with
(No column name)
,endeffectivedate
,starteffectivedate
from newtable
select softwaremanufacturer,productname,productversion
how do i finnaly concatenate this to say
select softwaremanufacturer,productname,productversion,endeffectivedate
,starteffectivedate
from newtable
thank you
August 15, 2013 at 7:06 pm
yes i was talking about columns,
select softwaremanufacturer,productname and productversion are columns and not rows as there are more columns I am looking to select.
select * from newtable does not specify...
August 12, 2013 at 5:06 pm
so it shows the softwaremanufacturer,productname,productversion then any other columns there may be in that particular order
I have tried
select softwaremanufacturer,productname,productversion, * from newtable
but it duplicates the softwaremanufacturer,productname,productversion because of using the...
August 12, 2013 at 3:39 pm
thankyou that works, not sure how to close this post though or mark it as solved
August 8, 2013 at 6:00 pm
Hi again Sean
everything works fine its just the drop column part it does not seem to like
--Now we drop the original column
alter table dbo.newtable
drop column @column1
regards
Alan
August 7, 2013 at 3:37 pm
Hi Sean
that works until i try and put it into a procedure and I get the error
Msg 102, Level 15, State 1, Procedure updatethecolumnsSMPV, Line 22
Incorrect syntax near '@column1'.
USE [TestData]
GO
/******...
August 7, 2013 at 3:10 pm
Hi Sean
The reason they change frequentl is that they are imported from a spreadsheet and the user selects the column name from a drop down box which matches the software...
August 7, 2013 at 12:46 pm
because the user has a dropdown box to either select it as the software manufacturer, product name or product version then I pass the name of the column across to...
August 6, 2013 at 4:17 pm
Hi Chris
I agree that what you say that it would work
with the
if RTRIM(@columnname1) = 'softwaremanufacturer' and RTRIM(@columnname2) = 'productname'
begin
...
August 6, 2013 at 3:45 pm
is there a way around this the as the variables
@columnname1 and @columnname2 could be named anything when they are passed in as this is selected from a dynamically imported spreadsheet
August 5, 2013 at 3:56 pm
I have managed a workaround, it is a bit longwinded but it seems to work as I have covered every scenario I think.
USE [TestData]
GO
/****** Object: StoredProcedure [dbo].[droptable] ...
July 10, 2013 at 4:29 pm
oh I see
the reason I am wanting to do this is that the user inports spreadsheets into the DB on a regular basis and if these columns exist then I...
July 10, 2013 at 3:56 pm
hi there thanks for your reply and yes it is the testbed, also it is still creating the file which happens very quick, but why it hangs i am not...
June 30, 2013 at 3:58 pm
ok i changed bcp to sqlcmd as follows but it does not work
Any ideas
USE [TestData]
GO
/****** Object: StoredProcedure [dbo].[exporttocsv] Script Date: 06/27/2013 12:23:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER...
June 27, 2013 at 4:26 pm
ok i have done that as follows
USE [TestData]
GO
/****** Object: StoredProcedure [dbo].[exporttocsv] Script Date: 06/27/2013 08:06:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[exporttocsv]
as
BEGIN
DECLARE @sql varchar(8000)
SELECT @sql...
June 26, 2013 at 4:19 pm
Viewing 15 posts - 31 through 45 (of 86 total)