Forum Replies Created

Viewing 15 posts - 11,041 through 11,055 (of 15,381 total)

  • RE: Help - Need to fill in parent lot tool info for given table

    One thing I would recommend is that you should ALWAYS specify the length of your character data. If you don't it will assume the default length. Do you know what...

  • RE: Help - Need to fill in parent lot tool info for given table

    thall 8753 (8/8/2012)


    Some background information is in order:

    3rd -7th columns refer to tools that lots are processed through, in that order.

    I need to be able to fill in the child's...

  • RE: hierachy with miltiple parent

    scottichrosaviakosmos (8/8/2012)


    create table #abc(insertid int,cityid int,parentcityid int,cityname varchar(50),parentname varchar(50))

    insert into #abc

    select 1,10,11,'A','B'

    union

    select 1,11,12,'B','C'

    union

    select 1,12,13,'C','D'

    union

    select 2,10,11,'A','B'

    union

    select 2,11,13,'B','D'

    union

    select 2,12,11,'C','A'

    Output:

    Insertid Cityid Parentid ...

  • RE: Nested Cursor in Stored Procedure

    I took the liberty of using an online sql formatter to make this a bit easier to read:

    DECLARE @DB_NAME VARCHAR(200)

    DECLARE @SQL2 VARCHAR(MAX)

    DECLARE DB_CUR1 CURSOR

    FOR

    SELECT [NAME]

    FROM dbo.sysdatabases

    WHERE (dbid > 4)

    AND STATUS...

  • RE: Triggers

    joshphillips7145 (8/8/2012)


    So I changed it to a Instead Of trigger and it now prevents any entries from being inserted but no error, I just cannot figure out why!!:sick:

    You changed...

  • RE: Triggers

    You are certainly pretty close. Here is a small little bit of help for working with triggers. They can be pretty difficult to debug because you can't just run it...

  • RE: Excluding data from a result set

    Nope no offense taken. It seems that you still have some issues getting the information you want out of your query?

  • RE: SQL is not utilizing an index it told me to create

    And take the suggestions for indexes with a grain of salt. The suggestions are not always good ones. You need to test actual performance before and after adding those indexes.

  • RE: Excluding data from a result set

    Luis Cazares (8/8/2012)


    Sean Lange (8/8/2012)


    A couple other suggestions. You should not declare @Date as varchar and turn around and force implicit conversions to datetime.

    I couldn't believe that @Date was declared...

  • RE: Urgent help please !!

    Still no ddl or sample data? Honestly how do you expect anybody to be able to decipher this from what you have posted? We can't see the tables, we don't...

  • RE: Help with query please ?

    Please don't start a new thread for the same topic. Please direct all replies here. http://www.sqlservercentral.com/Forums/Topic1341216-392-1.aspx

  • RE: Excluding data from a result set

    A couple other suggestions. You should not declare @Date as varchar and turn around and force implicit conversions to datetime.

    DECLARE @DATE VARCHAR(25)

    SET @DATE = '2012-08-01 23:59:59'

    Instead declare it as the...

  • RE: Triggers

    You still need to look closer at the inserted and deleted virtual tables.

    joshphillips7145 (8/8/2012)


    I Think this may be right now What would I do to test it? Write a select...

  • RE: Triggers

    joshphillips7145 (8/8/2012)


    Create Trigger NoDuplicates

    On TestUniqueNulls

    After Insert, Update AS

    Begin

    IF

    (Select Count(*)

    From TestUniqueNulls join TestuniqueNulls

    On TestUniqueNulls.NoDupName = TestUniqueNulls.noDupName) > 1

    Begin

    RollBack Tran

    RaiseError('Duplicate value', 11, 1)

    End

    End

    That is reasonably close. Take a look at the...

Viewing 15 posts - 11,041 through 11,055 (of 15,381 total)