Forum Replies Created

Viewing 15 posts - 361 through 375 (of 907 total)

  • RE: Merge into one Row

    A Pivot table query would work for you. You should be able to modify my "Pivot table without case statement" example. You can find that example here:

    http://www.geocities.com/sqlserverexamples/#pivot1

    Gregory Larsen,...

    Gregory A. Larsen, MVP

  • RE: Table Name As a parameter!!!

    Old habits are hard to break. Here is the same thing using sp_executesql:

    create PROCEDURE dbo.test

    @tableName varchar(20)

    AS

    declare @CMD nvarchar(1000)

    set @CMD = 'SELECT dbo. '+ rtrim(@tableName) + '.*' +

    ' FROM...

    Gregory A. Larsen, MVP

  • RE: Table Name As a parameter!!!

    Try this out:

    create PROCEDURE dbo.test

    @tableName varchar(20)

    AS

    declare @CMD varchar(1000)

    set @CMD = 'SELECT dbo. '+ rtrim(@tableName) + '.*' +

    ' FROM dbo.' + rtrim(@tableName)

    exec(@cmd)

    GO

    Gregory Larsen, DBA

    If you looking for SQL Server...

    Gregory A. Larsen, MVP

  • RE: Security Concern-How to remove hardcoded passwords

    I also have not detailed this out at all, but generally this is what I am thinking.

    There would be a process that would read the encripted login and password, then...

    Gregory A. Larsen, MVP

  • RE: Security Concern-How to remove hardcoded passwords

    We are running all of our jobs using the SQL Server job scheduler. All these jobs are connecting to SQL Server using a trusted connection.

    Another possible option...

    Gregory A. Larsen, MVP

  • RE: removing control characters from text field

    Looks like you have a number of examples. If your text data is really less than 8000 then looks like jpipes suggested a simple approach. Now I guess...

    Gregory A. Larsen, MVP

  • RE: removing control characters from text field

    Here is one possible solution. I'm guessing that someone else might have a better way. This particular example removes all the carriage return and line feed from a...

    Gregory A. Larsen, MVP

  • RE: Password in Batch File

    If the task scheduler and SQL Server box are one and the same, I think you can add local accounts to SQL Server and still use the trusted option.

    Gregory Larsen,...

    Gregory A. Larsen, MVP

  • RE: Column Update Doubt

    Below are two examples to do what you want. Hope this is what you are looking for.

    -- Example 1 only works id rows are returned in update...

    Gregory A. Larsen, MVP

  • RE: Error 8650 after installing SP4 on 7.0

    Guess I was trying to assess how much of an impact turning off parallelism migh cause. I'm assuming with parallelism turned on not all query the queries would get...

    Gregory A. Larsen, MVP

  • RE: Error 8650 after installing SP4 on 7.0

    Turning parallelism off, surely solves the problem, but I am wondering did parallelism work in SP 3 and earlier? Or where we just not seeing the errors, it really...

    Gregory A. Larsen, MVP

  • RE: Scripting Schema Changes

    Probably the easiest way is to go into "Design Table" in EM for the tables that you want to move columns around, and then used CUT/PASTE to reposition the column....

    Gregory A. Larsen, MVP

  • RE: Finding and ignoreing Big Bad Tables

    I also think you need to add to that sum, the size of the null block, and the variable block. Null block contains the null bit map, and the...

    Gregory A. Larsen, MVP

  • RE: Multiple Collations

    Here is an article I wrote about collation problems.

    http://www.sqlservercentral.com/columnists/glarsen/collate_part1.asp

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • RE: Format an amount

    Have you checked out the convert function?

    Try something like this:

    declare @N numeric(18,2)

    set @N = 49785.26

    select convert(char,cast(@N as money),1)

    set @N = 85.26

    select convert(char,cast(@N as money),1)

    set @N =...

    Gregory A. Larsen, MVP

Viewing 15 posts - 361 through 375 (of 907 total)