Forum Replies Created

Viewing 15 posts - 16 through 30 (of 345 total)

  • RE: Changing from "hard-coded" to dynamic query

    This will fix what you have:

    Declare @loopYrbeg int

    Declare @loopYrend int

    Declare @tablename sysname

    Declare @sql varchar(MAX)

    Set @loopYrbeg = 2007

    Set @sql = ''

    begin

    While @loopYrbeg < year( getdate() )

    begin

    Set @loopYrend = @loopYrbeg + 1

    Set...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: update trigger

    sej2008 (1/22/2013)


    Once again to bother you,but as per my code which is working fine as per my requirement ,it is an example from good sql book,there was an argument that...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Stored Procedure for dashboard

    smriti.subramanian (1/22/2013)


    Table structure:

    create table A

    id1 int,

    status int

    date created datetime

    ...

    I tried running this in SSMS and it didn't parse. If only we had some valid DDL. Oh well...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Stored Procedure for dashboard

    The "easiest to understand" type of solution is to build a temp table exactly like you want the output to look. Then have individual queries gather the pieces of information...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: trigger that will update one table when a record is updated in another

    briancampbellmcad (1/14/2013)


    Like this? (Still doesn't like near where the * is):

    ...

    WHERE Transaction_Type = 'Bulk Purchase' *

    GO

    Yes, like that but no asterix. You won't be using an *...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: ORDER BY Should be same as my input in IN()

    Lynn Pettis (12/26/2012)


    Josh Ashwood (12/26/2012)


    All hail Celko!!!!!

    :smooooth:

    Please, do not encourage him! We want him to go haunt an Oracle site for a while.

    Speak for yourself. You let him...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: SET QUOTED_IDENTIFIER ON

    Shadab Shah (12/21/2012)


    Abu Dina (12/21/2012)


    When I script out a stored procedure in SSMS, the SET QUOTED_IDENTIFIER ON is placed above the Stored procedure declaration. So I'm wondering, are you sure...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Dynamic query

    Jeff Moden (12/18/2012)


    toddasd (12/18/2012)


    Of course, I'd do this task like below. Be warned though, that I don't have to worry about sql injection in my closed environment.

    Famous last words. ...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Dynamic query

    Of course, I'd do this task like below. Be warned though, that I don't have to worry about sql injection in my closed environment.

    CREATE PROCEDURE [dbo].[spDmValidationCheckTODD](

    ...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Dynamic query

    To make what you have work, take a look a this:

    CREATE PROCEDURE [dbo].[spDmValidationCheck](

    ...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Help with Grouping data

    I can't see that what you need is more than this:

    --Report 1

    select Rank, Name, Board

    from MyTable

    sort by Rank, Name, Board

    --Report 2

    select Board, Name, Rank

    from MyTable

    sort by Board, Name, Rank

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Don't fire trigger from within a certain stored procedure

    Andre Ranieri (12/11/2012)


    Todsdad:

    I considered this but we do have some late shift employees who modify the account database through the CRM UI while the sproc is being run in the...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Don't fire trigger from within a certain stored procedure

    You could have the SQL Agent job disable the triggers.

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Need to create a table trigger

    This is the first result from Google:

    http://www.datasprings.com/resources/articles-information/creating-email-triggers-in-sql-server-2005

    Seems to cover what you need.

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: SET IDENTITY_INSERT [dbo].[tblTransactions] ON

    briancampbellmcad (12/6/2012)


    Your above code recommendation works perfectly... thank you for sharing! - Brian

    So did this one http://www.sqlservercentral.com/Forums/FindPost1393195.aspx

    But I understand the attraction Lowell's avatar brings. 😎

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

Viewing 15 posts - 16 through 30 (of 345 total)