Forum Replies Created

Viewing 15 posts - 2,686 through 2,700 (of 3,543 total)

  • RE: bcp statement

    Try this

    DECLARE @bcp as varchar(8000)

    select @bcp = 'CMD /C ' +

    'bcp "Select * From Salesperson_Dimension" queryout SalesPersonFiletemp.txt -S servername -T ' +

    ' && type SalesPersonFiletemp.txt >> SalesPersonFile.txt &&...

  • RE: Is it possible to grant exclusive execution on a SP?

    Top of the head idea, not tried or tested.

    Create a new table to contain two columns, procname and datetime. Put all sql in proc within a transaction. Add an update...

  • RE: Forcing continuous output from Stored Proc

    Thought it would cheer you up, after your rather terse post, you old sour puss you

  • RE: Forcing continuous output from Stored Proc

    Declare @sdate datetime, @edate datetime

    Set @edate = CONVERT(varchar(10),GETDATE(),102)

    Set @sdate = @edate - 11

    select s.SNUMBER, s.NAME, d.[DATE] as RecDate

    from dbo.SINFORM s

    left outer join dbo.DATARECS d

    on...

  • RE: Stored Procedure help required.

    Declare @sdate datetime, @edate datetime

    Set @edate = CONVERT(varchar(10),GETDATE(),102)

    Set @sdate = @edate - 11

    select s.SNUMBER, s.NAME, d.[DATE] as RecDate

    from dbo.SINFORM s

    left outer join dbo.DATARECS d

    on...

  • RE: A simple one ?

    Declare @sdate datetime, @edate datetime

    Set @edate = CONVERT(varchar(10),GETDATE(),102)

    Set @sdate = @edate - 11

    select s.SNUMBER, s.NAME, d.[DATE] as RecDate

    from dbo.SINFORM s

    left outer join dbo.DATARECS d

    on...

  • RE: Transforming Row into columns

    CREATE TABLE stagingtable(rowid int IDENTITY(1,1), input varchar(100))

    DTS into stagingtable, then select as follows

    SELECT u.input as 'User',ISNULL(t.input,'') as 'Time',ISNULL(l.input,'') as 'Location'

    FROM stagingtable u

    LEFT OUTER JOIN stagingtable t...

  • RE: Stored Procedure issue

    SELECT department,

      [Date],

      SUM(CASE [Product] WHEN 'E-Tech' THEN [output] else 0 END) as 'E-TECH',

      SUM(CASE [Product] WHEN 'E-9' THEN [output] else 0 END) as 'E-9',

      SUM(CASE...

  • RE: Stored Procedure issue

    If you replace [Daily Total] in the first select with

    SUM([Daily Total]) as 'Daily Total'

    and remove [Daily Total] from the GROUP BY clause

    then you should get

    110 2004-04-01 00:00:00 146.0 0.0...

  • RE: Best data type for storing "Hours"

    Smallmoney is 4 bytes and has a maximum of 214,748.3647

    To hold the equivalent in decimal would be 9 bytes decimal(10,4)

    However if you are only storing to 2 decimal places then

    smallmoney...

  • RE: To Default or not to Default

    alzdba,

    I am writing some of the procs, but the 3rd party will be writing some. I have two choices, either put defaults on the columns where needed (they are NOT...

  • RE: How can I make connection to a Solid DB?

    OK some simple instructions to get you foing

    DTS is Data Transformation Services. It allows the transfer and transformation of data to/from SQL server.

    In EM (Enterprise Manager), expand your server

    Select your...

  • RE: Best data type for storing "Hours"

    From BOL:

    p (precision)

    Specifies the maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be...

  • RE: Stored Procedure issue

    There was errors in the case statements and i missed product in the select. When using subqueries you have to give them an alias, i called the subquery a but...

  • RE: Stored Procedure issue

    Try this

    SELECT department,

      [Date],

      SUM(CASE [Product] WHEN 'E-Tech' THEN [output] else 0 END) as 'E-TECH',

      SUM(CASE [Product] WHEN 'E-9' THEN [output] else 0 END) as 'E-9',

     ...

Viewing 15 posts - 2,686 through 2,700 (of 3,543 total)