Forum Replies Created

Viewing 15 posts - 151 through 165 (of 199 total)

  • RE: Table Variables

    Hi,

    I have the same problem as Sam, if you can do it with temp tables - you should be able to do it with table variables.

    There are plenty of existing...

    Steve

    We need men who can dream of things that never were.

  • RE: Trigger question

    OR

    CREATE TRIGGER [tr_Update]

    ON [dbo].[TableName]

    AFTER UPDATE

    AS

    IF ((SELECT COUNT(PK) FROM INSERTED) > 0) AND ((SELECT COUNT(PK) FROM DELETED) > 0)

    BEGIN

    UPDATE TableName SET UPDATED = 'UPDATED'

    WHERE TableName.PK = (SELECT PK FROM...

    Steve

    We need men who can dream of things that never were.

  • RE: sql reporting

    SELECT

    FROM

    ORDER BY company_no  dept_no

    Have fun

    Steve

    We need men who can dream of things that never were.

  • RE: Dynamic SQL problem

    Frank got in whilst I was writing my reply - bugger.

    For a proper answer on temp tables he's your man..........

     

    Steve

    We need men who can dream of things that never were.

  • RE: Dynamic SQL problem

    Hi Richard,

    The error you describe is in the initial declaration of @cSQL2, you must have declared it as a varchar(x) - it just needs changing to nvarchar(x) and we should...

    Steve

    We need men who can dream of things that never were.

  • RE: Dynamic SQL problem

    Hi Richard,

    Executing @cSQL2 will generate a new spid, unfortunately the way you have declared and used the variable it will only be available during the life of the spid (and thats if...

    Steve

    We need men who can dream of things that never were.

  • RE: Pass a list of strings to a stored procedure

    Hi Allan,

    Would it not be easier to build up the whole of the sql into a string and exec it?

    This works perfectly, depends if you can build it......

    DECLARE @sql varchar(8000),

     @varNames...

    Steve

    We need men who can dream of things that never were.

  • RE: need a little help with my convert statement of DATETIME TO DATE

    Hi Lee,

    Not really spent much time with Crystal 9. Can you not allow the users to enter a normal dd/mm/yyy format as a string variable and convert it silently behind...

    Steve

    We need men who can dream of things that never were.

  • RE: need a little help with my convert statement of DATETIME TO DATE

    Hi Lee,

    Try this

    select convert(char(10), booking.book_date,101) from TableName

    Have Fun

    Steve

    We need men who can dream of things that never were.

  • RE: which is repeated more than 2 times

     

    Or :-

    SELECT ename, city FROM employees GROUP BY ename, city HAVING COUNT(ename) > 1

    just play with it to suit your needs.

    Have fun

     

    Steve

    We need men who can dream of things that never were.

  • RE: which is repeated more than 2 times

    Or if you want to list employees in more than one city.

    SELECT ename, city FROM employees GROUP BY ename, city HAVING COUNT(city) > 1

    Steve

    We need men who can dream of things that never were.

  • RE: which is repeated more than 2 times

    SELECT ename FROM employees WHERE City IN ('Pune', 'hyd')

    Steve

    We need men who can dream of things that never were.

  • RE: Substring Replacement

    Doug,

    Quick knock together, seems to work fine for what you are trying to accomplish but needs tidying up.

    DECLARE @SectionToChange varchar(2),

     @MAPIString varchar(8000),

     @StartPos int,

     @EndPos int,

     @DataLength int,

     @ReplacementData varchar(500)

    SET @MAPIString = 'MAPI:{Cortez, Jorge}EX:/o=Company Name/ou=Data...

    Steve

    We need men who can dream of things that never were.

  • RE: One "big" Parameter -- Please Help

    Hi,

    I came across the same thing recently and found this excellent piece of code stashed away in one of the forums. Unfortunately I cant find it now

    Steve

    We need men who can dream of things that never were.

  • RE: Populating @Variables dynamically

    Hi Farrel,

    Check your PM.

    The only other reason I can think of for the variables dropping out of scope like that is if you are using GO to keep your transact...

    Steve

    We need men who can dream of things that never were.

Viewing 15 posts - 151 through 165 (of 199 total)