Forum Replies Created

Viewing 15 posts - 1,906 through 1,920 (of 3,221 total)

  • RE: Concatenate into fixed length

    Is this what you are looking for:

    CREATE TABLE #TableA(UserNum INT, FirstName VARCHAR(20), LastName VARCHAR(30))

    INSERT INTO #TableA

    SELECT 1,'Michael','LongerName' UNION ALL

    SELECT 12345, 'John', 'Smith' UNION ALL

    SELECT 12, 'Dave', 'Brown'

    SELECT CAST(UserNum AS CHAR(10)),...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Are the posted questions getting worse?

    Now here is an OP ... hmmmm

    http://www.sqlservercentral.com/Forums/Topic932864-8-1.aspx#bm932955

    timmynew11

    Thanks, but i figured out my issue with a cartesian join. It appears you have too much time on your hands to post...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Create date range with only one date using previous record's END DATE

    timmynew11

    To receive tested code please post table definition(s), sample data and desired results in an easily consumable format.

    Refer to the first link in my signature block for explicit...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: T-SQL

    marklegosz

    I liked the SQL as a graphic - stopped me from either running the code or adjusting the layout to read better. I actually feel better about having gotten it...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Filtering Members based on their names from the set(MDX)

    Hope this helps:

    CREATE TABLE #Dw(Color VARCHAR(20),[Revision Number] INT)

    INSERT INTO #Dw

    SELECT 'Black', 9843 UNION ALL

    SELECT 'Blue', 3970 UNION ALL

    SELECT 'Grey', (null) UNION ALL

    SELECT 'Multi', 3926 UNION ALL

    SELECT 'NA', 28919 UNION ALL

    SELECT...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: date grouping

    spattah

    Without table definition(s), sample data it is difficult to provide an answer to your request. Please refer to the first link in my signature block for information as to...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: how to declare , change and insert the default value of Table in Store Procedure on fly

    CREATE PROCEDURE TestD

    @id int,

    @Name nvarchar(60),

    @Signature nvarchar(100),

    @PrivacyId Int = 0,

    @Visible bit = 0

    AS

    INSERT INTO #T

    VALUES(@id,@name,@Signature,@PrivacyId,@Visible)

    TestD 1,'First','whatever'

    TestD 2,'Second','something',1,1

    SELECT * FROM #T

    Result:

    IdNameSignaturePrivacyIdVisible

    1Firstwhatever0 ...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: NOFORMAT AND NOINIT?

    I would suggest that you use Books On Line (BOL) and using the index feature search for each term ....I'll even give you another hint.... look at the T-SQL example...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: Compute addition of datetime fields

    Semingly endless T_SQL for various date time calculations. Read this by Lynn Pettis for help.

    https://www.sqlservercentral.com/blogs/lynnpettis/archive/2009/03/25/some-common-date-routines.aspx

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: What seems like an easy task is kickin my butt. :(

    john-902052

    I entered all the data (original and additional) and ran your code from the forum entry of 2:12 PM

    declare @StartDate datetime

    declare @EndDate datetime

    set @StartDate = '2/1/2010'

    set @EndDate = '2/20/2010'

    select convert(datetime,...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: What seems like an easy task is kickin my butt. :(

    When I ran your code this was my result:

    TransDate dailyTotalpaytypepaytypedesc

    2010-02-10 14:08:48.00045.00 1Cash...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: OPENROWSET Command Error

    This article should assist you in identifying the registry setting, as well as guiding you as to how to modify it.

    http://support.microsoft.com/kb/327489

    If you are not familiar with how to modify registry...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: How to delete the duplicate records in the table ?

    Try this for test purposes,

    ;with numbered as(SELECT rowno=row_number() over

    (partition by i,b order by i),i,b from #t1)

    select * from numbered

    /*Giving the following results:

    rowno ...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: detect change in a database

    "what tables changed" do you mean?

    1. Table definition (such as add / delete a column, or alter column type / size, or add / remove / alter...

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • RE: consolidate MSDB

    Read this blog post on how to script out Jobs, you can use these scripts to create the jobs in MSDB for your restored (newly attached) database.

    http://blogs.msdn.com/jenss/archive/2009/01/27/script-out-jobs-in-sql-server.aspx

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

Viewing 15 posts - 1,906 through 1,920 (of 3,221 total)