Forum Replies Created

Viewing 15 posts - 1,741 through 1,755 (of 2,894 total)

  • RE: number that increment at teh start of each cycle and resets for each new district

    this should be reset for each district and incremented at each new dq_rec_start_cycle_ind

    If I understand you correctly, you want something like:

    district | dq_rec_start_cycle_ind | cycle_count

    1 ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: mult joins

    ...I was making the assumation (bad thing to do at times) that the OP was talking about joining tables together on multiple columns...

    You never know for sure :hehe:

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: use print statement in stored procedure

    RAISERROR ('My debugging text', 10,1) WITH NOWAIT

    Will return message back to caller immediately. Using ADO.Net SqlInfoMessage you can subscribe to it and get it back during stored proc asynchronous...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: number that increment at teh start of each cycle and resets for each new district

    Cannot see your attachment and your question is not very clear. However, I guess, what you need is:

    ROW_NUMBER() OVER (PARTITION BY [ditsrict column name] ORDER BY [whatever column you want...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to reoke permissions on a particular Role

    What do you mean "full permission"?

    You can remove permission from role using REVOKE

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Migrating data in sql server from source to target with Schema change in target

    Placed your code into my query window and executed it.

    No problems at all! All five records inserted with Location set to USA a per default.

    Are you sure you are getting...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: use print statement in stored procedure

    CELKO (4/16/2012)


    Yes, but it is bad programming. The PRINT is for debugging and not production code. Think about 100 people calling the same program. You do not want to directly...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: use print statement in stored procedure

    For the purpose you need, the best way is to use RAISERROR like that:

    RAISERROR ('My debugging text', 10,1) WITH NOWAIT

    It's the same as PRINT, but it guaranteed to be returned...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: mult joins

    l090475 (4/16/2012)


    Can you join a table to multiple columns?

    The correct answer to this question is: NO! You cannot join table to multiple columns!

    More than that, you cannot joint table...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Migrating data in sql server from source to target with Schema change in target

    If you have default constraint on the column and do not specify this column in the column list of insert statements it should work.

    Could you please post full ddl of...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Running same SQL code against a number of tables

    I'm glad it did help you.

    But it worth to mention that I would just use normal cursor and dynamic sql. That is exactly the case where using cursor is...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: "Variable" for switching Table Names

    ...

    Note that using Dynamic SQL is an expensive SQL operation.

    ...

    What do you mean by "expensive"? It's as affordable as anything else.

    Just use it properly with sp_executesql and parameters...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how can i insert in udf

    Good for you! It is easy now. Here is an answer:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: No rows Returning

    sqlbi.vvamsi (4/16/2012)


    Hello,

    I've a table with a numeric and date columns. Assuming a,b are the column names, I'm writing a query which isn't returning any rows. Below is the query

    select *...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Running same SQL code against a number of tables

    Another way, using sp_msforeachtable:

    create table dbo.OutputTable (OriginTableName nvarchar(500), RecordCount INT)

    create table dbo.TableList (Name nvarchar (500))

    insert dbo.TableList

    select '[dbo].[swap]'

    union select '[dbo].[products]'

    union...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 1,741 through 1,755 (of 2,894 total)