Forum Replies Created

Viewing 15 posts - 346 through 360 (of 489 total)

  • RE: How Dynamic SQL Can Be Static SQL

    This is how example 2 can be reworked with a CASE function in the ORDER BY clause that properly sorts by the datetime field:

    DECLARE @column varchar(10)

    SET @Column = 'title'

    ...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: How Dynamic SQL Can Be Static SQL

    If you look at example 2 of my article you will notice that the two times I use the CASE function with a datetime field I cast the datetime field...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Restoring database to a new server

    If your difficuly with copying the backup is that it takes hours you might try the following. When I would copy backups from production to our development environment it...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Fatal error 7102

    The event viewer log doesn't help much. And we had already viewed the SQL Server logs, they don't help either.

    Robert Marda

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: How do you combind these 2 SQL Statements?

    I don't know what Dreamweaver UD is? I do know that the code won't work without the DECLARE statement. Can't you place the DECLARE statement in UD? ...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Dynamic SQL vs. Static SQL Part 2, Code

    Thanks!

    Robert Marda

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Recursive Stored Procedure

    Here is another suggestion:

    DECLARE @referer_id int, @downlineID varchar(4), @rowcount int

    CREATE TABLE #Count ([name] varchar(3))

    SET NOCOUNT ON

    SET @referer_id = 6

    SET @rowcount = 1

    WHILE @rowcount <> 0

    BEGIN

    INSERT INTO #Count ([name])

    SELECT RIGHT([name],3)

    FROM usr

    WHERE...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: How do you combind these 2 SQL Statements?

    One way to combine the two is this:

    DECLARE @Count int

    SELECT @Count = COUNT (*) FROM submission WHERE sup_contact_id = (SELECT s.sup_contact_id FROM submission s INNER JOIN supplier_contact r ON

    s.sup_contact_id =...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Bread Crumb SELECT ? Is It Possible

    See if this does what you want:

    DECLARE @MenuItem int, @Navigation varchar(300)

    SET @MenuItem = 6

    SET @Navigation = ''

    WHILE @MenuItem IS NOT NULL

    BEGIN

    SELECT @Navigation = MenuItem + ',' + @Navigation

    FROM t_Menu

    WHERE t_Menu_pk...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Dynamic SQL vs. Static SQL Part 2, Code

    I'm glad to here you enjoyed the article.

    Unfortunately, I don't have a better solution due to the fact that I am still working with SQL Server 7.0 where partitioned views...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Capturing Deadlock Info

    I already have a process that captures only deadlock spids and then captures what the spids are doing and all this occurs before SQL Server kills one of the processes...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Capturing Deadlock Info

    I found what blocks you from adding a trigger to a system table; the flag in sysobjects that indicates the table is a system table. Using a test table,...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Dynamic SQL vs. Static SQL Part 2, Code

    I'm not taking it as criticism. I agree, if you don't ever have to touch it again then yes its simpler. Sometimes I get so focused on one...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Dynamic SQL vs. Static SQL Part 2, Code

    If its a simple query, say only a few lines then you can easily argue the point that dynamic SQL could be simpler than static SQL to maintain. For...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • RE: Dynamic SQL vs. Static SQL Part 2, Code

    I am glad that article helped both of you. I am still trying to convert many of our dynamic SQL to static SQL and some of these stored procedures...

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

Viewing 15 posts - 346 through 360 (of 489 total)