Forum Replies Created

Viewing 15 posts - 31 through 45 (of 86 total)

  • RE: select only some rows and then the rest

    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

  • RE: select only some rows and then the rest

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

  • RE: select only some rows and then the rest

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

  • RE: sp_rename help

    thankyou that works, not sure how to close this post though or mark it as solved

  • RE: sp_rename help

    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

  • RE: sp_rename help

    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

    /******...

  • RE: sp_rename help

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

  • RE: Confused with my procedure

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

  • RE: Confused with my procedure

    Hi Chris

    I agree that what you say that it would work

    with the

    if RTRIM(@columnname1) = 'softwaremanufacturer' and RTRIM(@columnname2) = 'productname'

    begin

    ...

  • RE: Confused with my procedure

    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

  • RE: Procedure or function not working correctly

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

  • RE: Procedure or function not working correctly

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

  • RE: SQLCMD hanging

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

  • RE: bcp export problem

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

  • RE: Data export where am i going wrong

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

Viewing 15 posts - 31 through 45 (of 86 total)