Forum Replies Created

Viewing 15 posts - 1,786 through 1,800 (of 3,543 total)

  • RE: union all and order by help!

    I stand corrected

  • RE: query to search through different servers

    Sorry my bad

    Try this

    DECLARE @srvname varchar(255)

    CREATE TABLE #temp (srvname sysname,dbname sysname,oname sysname,uname sysname,uid smallint)

    DECLARE mycurs CURSOR FOR

    SELECT srvname FROM master.dbo.sysservers...

  • RE: Need 2nd row of excel

    Yeah that has happened to me, sometimes either way works sometimes not

    May be MS should call them 'Sticky Cells'

  • RE: union all and order by help!

    Answer is no but you do not need a UNION use CASE instead

    SELECT *

    FROM tblCountry

    ORDER BY CASE WHEN Country_Id = 26 THEN 1 ELSE 2 END, Country_Name

  • RE: Need 2nd row of excel

    quoteWatch out setting the row number to a large number as dts will process theses rows

    Not for me...

  • RE: Need 2nd row of excel

    Set Last Row to a very high number eg 999,999,999

  • RE: INSERT and UPDATE in Same Web Page

    Not sure what your problem is but I doubt if SQL is confused about INSERT or UPDATE, maybe your code logic is.

    To to do what you are doing then I...

  • RE: parameters

    alter Procedure testLoad

    (

    @FileName varchar(50),

    @Logon  varchar(20),

    @BusArea_out char(2)OUTPUT,

    @PayId_out char(3)OUTPUT,

    @CycleNo_out char(7)OUTPUT

    )

    As

    SET NOCOUNT ON

    DECLARE @File_Exists int,

     @textfile char(150),

     @BusArea  char(2),

     @PayId   char(3),

     @Login   varchar(20),

     @CycleNo char(15),

     @FHBusArea  char(2),

     @FHPayId  char(3),

     @FHCycleNo char(15),

     @TrBatchPoNo char(10),

     @rename  varchar(255),

     @file_extn  datetime

    SELECT @BusArea = SUBSTRING(Col001,194,2),

    @PayId = SUBSTRING(Col001,196,3),

    @CycleNo...

  • RE: query to search through different servers

    Alternatively if you want all the results in one table then

    DECLARE @srvname varchar(255)

    CREATE TABLE #temp (dbname sysname,oname sysname,uname sysname,uid smallint)

    DECLARE mycurs CURSOR FOR

    SELECT srvname FROM master.dbo.sysservers WHERE...

  • RE: query to search through different servers

    The query returns queries that you paste into another QA window to execute.

    Sorry for any confusion

    If you want the query to execute the...

  • RE: Design Question

    Why are Table2 and Table3 separate, what is unique about them for them to be separate?

    If they were one table your contraints would be easier to implement

  • RE: Dynamic database name

    Nicely put

  • RE: OPENROWSET Update Error

    Check the table that is being updated has a uniqure index on it

    Plus I thought updates had to be like

    UPDATE OPENROWSET('SQLOLEDB','xxx.xxx.xx.xxx';'user';'PWD',

    'SELECT myCol FROM MyDB.dbo.TEST WHERE mycol=2222')

    SET myCol =...

  • RE: Query Result

    SELECT col1,

    CAST(SUM(ABS(SIGN(Col2 - 1)) ^ 1) as varchar) + '/' + CAST(COUNT(*) as varchar) AS [Rate],

    COUNT(*) AS [Total]

    FROM @test-2

    GROUP BY col1

  • RE: Dynamic database name

    EXECUTE('select * from [' @dbname '].dbo.sysfiles')
    to stop sql injection attack

Viewing 15 posts - 1,786 through 1,800 (of 3,543 total)