Forum Replies Created

Viewing 15 posts - 2,596 through 2,610 (of 5,103 total)

  • RE: Nested SP

    Jp, Hopefully you understand this:

    CREATE PROCEDURE dbo.A

      (

       @PersonnelNumber As Integer,

       @dis_id int output

      )

    as

     SELECT      e.DisciplineID

     

     FROM    Employees e

     

     WHERE

     

     e.PersonnelNumber =  @PersonnelNumber

    GO

     

    --------------------------------------------------------------------------------

    CREATE PROCEDURE dbo.B

      (

       @PersonnelNumber...

  • RE: Nested SP

    if the "result" of sp1 is a variable then just use the output keyword

    create proc sp1 @data_in int, @data_out int output

    as

     set @data_out = @data_in -1

     

    create proc sp2 as

    begin

    declare @i int,...

  • RE: NULL

    Ah ...  perspectives ...

    In that case let me write mine

     Select  @balance  = sum(isnull(saleAmount, 0)) - sum(isnull(PaymentAmount,...

  • RE: @@servername ????????? empty output

    anyone knows why in some sqlservers @@servername is an empty string ?????? 

    This happens when the server is renamed

    Read previous post for the solution!

     

  • RE: Create Table from another Table

    We all have been there many times

  • RE: NULL

    You are mixing two concepts:

    Balance is the recordset returned by your query. Return is an output parameter you need to decide if you want your results back as recordset or as...

  • RE: Create Table from another Table

    It all depends what you need this for but in case you want a temporary image:

    Select *

    into NEWTABLE

    from SOURCETABLE

    where 1=2

     

    Will do just that

  • RE: Lock Question (Yawn!)

    The way to implement this is to use a separated table which contains the next ID as column and you can readit and updated in one statement with no locks...

  • RE: Can''''t get UDF to replace Cursor

    Farrell,

    you are probably missing one IsNull function on the concatenation:

    CREATE FUNCTION dbo.GetInternationalCodes( @ID integer)

    RETURNS varchar(250)

    AS

    BEGIN

         DECLARE @IntlCodes varchar(250)

         SET @IntlCodes = ''

         SELECT @IntlCodes...

  • RE: Change of Domain on SQL Server machine

    I was involved once with Aelita Software in an AD migration and the tool actually performed very well. They were bought by Quest Software and I don't really know in...

  • RE: Cube Question...I think

    Just comment out the group by !?!

    Select sum(permitest) As PermitEst

         , sum(PermitProcEst) As PermitProcEst

         , Sum(techaudEst) As techAudEst

         , sum(FreightEst) As FreightEst

         , sum(ElectricalEst) As ElectricalEst

         , sum(RemDispEst) As RemDispEst

        ...

  • RE: Help with union

    I think this is maybe what you want:

    SELECT TABLE_A.col_a, TABLE_A.col_b, TABLE_A.col_c, TABLE_B.col_d 

    FROM TABLE_A Left join TABLE_B on TABLE_A.key = TABLE_B.key

  • RE: Need help with Bulk Insert ASAP

    Not sure what your conditions are for the import but I would change the recovery model of your DB to BulkLogged First, then perform the Import and finally change the...

  • RE: OH MY!

    >>Could someone please tell me what the 1,1, is for in this raised error?<<

    This is use to generate an error with no consequences (on client side). Meaning only informational nature...

  • RE: Better way to check for value

    Correct! Jo's will execute both but because they are mutually exclusive only one of them will contain rows.

    As a bit of optimization you can try a "union all" instead

    insert ...

    select...

Viewing 15 posts - 2,596 through 2,610 (of 5,103 total)