Forum Replies Created

Viewing 15 posts - 10,801 through 10,815 (of 13,460 total)

  • RE: Copying A Record With Childrent Records In Many Tables Using Cursors

    if you can provide the actual CREATE TABLE statements for the tables in question, we could help you better;

    sp_fkeys tblBOQ would give all the dependant tables to the table(is that...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Copying A Record With Childrent Records In Many Tables Using Cursors

    yes, it will still work, you just have to follow all of the nodes of the tree:

    for example, say my "Childtable" has FK records to it:

    it might not be obvious,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: order by alphanumeric value

    another way to do the same thing is to order by the length, then by the column:

    select * from #temp order by len(Response),response

    ...well not the same thing, but similar...with the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Copying A Record With Childrent Records In Many Tables Using Cursors

    a much better solution is to use a set based operation; cursors are much slower.

    you didn't provide any details, so here's a rough example:

    by "copying", I'm assuming you mean to...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Data getting deleted automatically

    i would suggest adding a trace as well as the fine trigger example above; there's a thread here with my example of the trace i use:

    http://www.sqlservercentral.com/Forums/FindPost745574.aspx

    with the trace, you'd see...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Difference in time to fetch results between a select * and select count(*)

    with a table with no index, SQL server automatically creates a heap index, so there is at least some information on your table.

    for the count, I'm guessing that although it's...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: EXECUTE AS 'TRMR'

    Execute as user = 'NA\TRMR'

    BACKUP DATABASE [ReportServer]

    TO DISK = N'C:\SQL Server - Backups\ReportServer\JUL20_1332_2009.bak'

    correct me i'm wrong, but you saved this script as a stored procedure, and the stored...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: CASE Statement NOT working...

    donato, are you trying to usee a CASE statement to return a desired value as a column, or as a WHERE condition?

    SELECT

    CASE

    WHEN ITM.MNR_CD = '100' THEN '15'...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Server 2000 with Access 2000 VBA Can't find object 'st.....' stored procedure

    yes; like i had said before, I'd seen the issue in the past. I could never track down exactly what was the cause, but I found that changing that default...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: ANyOne know why figure why my 1st Cursor is not updating anything

    Jeff Moden has a great quote on changing your mindset from row by row to "set based" thinking:

    First step towards the paradigm shift of writing Set Based code:

    Stop thinking...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: ANyOne know why figure why my 1st Cursor is not updating anything

    i was kind of assuming the update was more complicated...you know 500-1000 might be a different multiplier, for example. there was no good reason for it, other than to allow...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: ANyOne know why figure why my 1st Cursor is not updating anything

    here's my WAG based on your SQL:

    UPDATE CP

    SET CP.BaseRate = CASE

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: ANyOne know why figure why my 1st Cursor is not updating anything

    your cursor does not have an update statement...the only thing it is doing is fiddling with the variable @BaseRate i think.

    did you forget to add the UPDATE to teh cursor?

    WHILE...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Sending emails

    I think Jack might have the key right there: Exceeded storage allocation. is mailbox full, right?

    alternatively, maybe your server is set for 10 Megs, but the destination server's limit...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: sql server error: 2146893044

    you should paste the whole error;

    when i googled "error -2146893044"

    i found "error -2146893044: The logon attempt failed " in the first 3 links, but it seemed to be referencing network...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 10,801 through 10,815 (of 13,460 total)