Forum Replies Created

Viewing 15 posts - 1,051 through 1,065 (of 2,894 total)

  • RE: confusion in setting up superkey

    ...

    now I want to set superkey on (VENDORID+ADDRESS+CITY) which identify unique record.

    ...

    Why three of them? Are you saying that VENDORID in your VENDOR table is not unique by itself?

    Or, you...

  • RE: Select Query to return all rows from one table

    Jay B-317395 (10/16/2012)


    Many thanks for the help below is what worked for me

    SELECT *, dbo.tPeriod.PeriodDiscription, dbo.[tTimeTable2012-13].StaffID, dbo.[tTimeTable2012-13].DayID

    FROM dbo.tSubject

    INNER JOIN dbo.[tTimeTable2012-13] ON dbo.tSubject.SubjectID = dbo.[tTimeTable2012-13].SubjectID

    AND (dbo.[tTimeTable2012-13].StaffID = 18) AND...

  • RE: replace

    vivekkumar341 (10/16/2012)


    Hi,

    i had gone through your example its look wrong.

    please find the detail.

    declare @int1 varchar(100) = '100000000',

    @int2 varchar(100) = '984541',

    @int3 varchar(100)

    your suggestion was mentioned below:

    set @int3 = STUFF(...

  • RE: Bizarre issue while using datetime variable instead of harcoded value

    jeyis (10/16/2012)


    datatype of coldate is datetime,

    there is no difference in the execution plan of both queries.

    Thanks Eugene Elutin for that date format practice .. old habits hard to change...

  • RE: error - incorrect syntax near '4'

    For some reason I think that you are not executing the proc you think you do.

    Try simple test:

    Change proc to something like:

    ALTER PROCEDURE [dbo].[usp_updaterate]

    AS

    BEGIN

    RETURN;

    END

    Then execute...

  • RE: Database Shrink

    The answer is in here:

    http://msdn.microsoft.com/en-us/library/ms190488.aspx

    DBCC SHRINKDATABASE operations can be stopped at any point in the process, and any completed work is retained.

  • RE: Bizarre issue while using datetime variable instead of harcoded value

    Is it just a query behaviour or you see it only when wrapped into stored procedure?

    Does look like parameter sniffing to me...

    Also, it's a bad practice to use strings for...

  • RE: error - incorrect syntax near '4'

    ssurekha2000 (10/15/2012)


    no i have not created anytriggers

    Can you please post exact error message you have from your application including error source (call-stack would be even better)

  • RE: first official day of every month for past 3 years

    No much details isn't it.

    So very generic answer:

    SELECT YEAR(YourDateColumn)

    ,DATENAME(MONTH,MONTH(YourDateColumn)

    ,MIN(YourDateColumn) AS [first run date in this month]

    FROM [YourTable]

    WHERE...

  • RE: Select Query to return all rows from one table

    The style you used to write your query I call "noodles" as it takes to much time to read top understand what you're are doing.

    Bit messy, really.

    I think the following...

  • RE: error - incorrect syntax near '4'

    Is it SQL error or application error? Your SP looks fine.

    Any triggers on tables involved?

  • RE: Dumb? SQL Question

    ... There wouldn't be any overhead since the DB isn't querying anything to get the value of [a].

    ...

    Except the fact that this will lead to full table...

  • RE: Run time of Cursor

    Yeah, it does look more like Jeff Moden nighmare :w00t:

    Or, may be, is taken from Oracle...

    Your given example doesn't contain anything qualifying use of cursors (or WHILE LOOPs, which may...

  • RE: Char And int

    Looks like you need to filter some kind of staging table...

    That what you can try:

    declare @t table (SomeVal nvarchar(100))

    insert @t

    select '1' union all

    select '9' union all

    select '11' union all

    select...

  • RE: Convert single table to parent-child tables.

    The easiest and fastest way to get it done, is to add temporary SSN column into Parent table, so you can keep correlation between new generated ParentId and existing SSN....

Viewing 15 posts - 1,051 through 1,065 (of 2,894 total)