Forum Replies Created

Viewing 15 posts - 331 through 345 (of 402 total)

  • RE: Query help for a table

    CELKO (3/21/2012)


    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. If you know how,...

  • RE: Transactional Replication

    Nope, they can have different names

    Andy

  • RE: Disable and enable trigger

    What utter nonsense

    Thats no way to speak to such a helpful chap as Jeff 😛

  • RE: Find and Replace SSIS Package

    Another option would be to create a template package (http://support.microsoft.com/kb/908018) although I've not tried that myself.

    I use template packages quite a bit (one for each of my data warehouses) and...

  • RE: Fetch table name,size

    Your welcome 🙂

  • RE: Fetch table name,size

    Hi

    Here is a piece of code that I use to accomplish this:

    SET NOCOUNT ON

    --Get a summary of the entire database.

    EXEC sp_spaceused

    --Declare needed variables.

    DECLARE

    @max-2 INT,

    @min-2 INT,

    @owner NVARCHAR(256),

    @table_name NVARCHAR(256),

    @sql NVARCHAR(4000)

    DECLARE @table TABLE(

    ident...

  • RE: Help on sorting results using sql

    Eugene Elutin (3/15/2012)


    Simple change to the ordering from this:

    ORDER BY

    CHARINDEX('ber',City)

    ,City

    To This

    City

    ,CHARINDEX('ber',City)

    Should handle this...

    Nope, it will not.

    It will place Aberlin before Berlin....

    I think I need to go...

  • RE: Help on sorting results using sql

    Eugene Elutin (3/15/2012)


    Andy, actually, use of CHARINDEX for ORDER BY here will not satisfy OP requirements. Try to add another City like that:

    UNION ALL SELECT'Zberlin'

    You query will place it straight...

  • RE: Help on sorting results using sql

    Eugene Elutin (3/15/2012)


    Please, read the article from the link at the bottom of my signature

    -- to help your helper you should provide

    -- "I have table like that:" like that:...

  • RE: Help on sorting results using sql

    Hi

    Does do what you need?

    DECLARE @temp AS TABLE

    (City VARCHAR (20))

    INSERT INTO @Temp

    SELECT'Aberlin'

    UNION ALL SELECT'Berlin'

    UNION ALL SELECT'Berlina'

    UNION ALL SELECT'Zedberlin'

    UNION ALL SELECT'Youberlin'

    UNION ALL SELECT'Irrelevant'

    UNION ALL SELECT'MoreIrrelevant'

    SELECT *

    FROM @Temp

    WHERE

    City...

  • RE: using ' within a Unicode sting

    Not a stupid question at all! 🙂

    Your welcome

    Andy

  • RE: Query assistance request

    If you only want to see the Encounter value once in the result set, I'd add the DISTINCT keyword to Andy's great response, as follows:

    D'oh spot on! Forgot to add...

  • RE: using ' within a Unicode sting

    As far as I know no not using single quotes - you need to use double quotes.

    use msdb

    go

    sp_help_job

    @job_name = N'Daily ''full'' backup',

    @job_aspect = N'all'

  • RE: Query assistance request

    Hi

    SELECT

    Encounter

    FROM

    JeffTest

    WHERE

    Encounter NOT IN ( SELECT Encounter FROM JeffTest WHERE DocType = 305 )

    Andy

  • RE: alter table name error and table column

    For renaming a column the syntax is:

    EXEC sp_rename 'Table.OldColumnName', 'NewColumnName', 'COLUMN'

    Andy

Viewing 15 posts - 331 through 345 (of 402 total)