Forum Replies Created

Viewing 15 posts - 11,581 through 11,595 (of 13,460 total)

  • RE: Calling Stored procedure at specific time

    Here's a complete example for you...

    you simply change whatever application is looking at "my_table" to report the current status to point to "ViewOfMyTable"...all done...no process needing to run every thirty...

    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: generating non-numeric primary key

    well...you can have a calculated column as a primary key...so i'd make it built off of an identity like this:

    [font="Courier New"]CREATE TABLE #example(myid INT IDENTITY(1,1),

    myCalculatedPK AS 'martmp_' + RIGHT('00000000' +...

    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: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS

    select

    ALIAS1.naam,

    ALIAS1.Aantal_Incidenten,

    ALIAS2.naam,

    ALIAS2.Aantal_Inc_Portal

    FROM

    (

    select vestiging.naam, count(*) as Aantal_Incidenten

    from incident, vestiging

    where incident.aanmeldervestigingid = vestiging.unid

    group by vestiging.naam

    ) ALIAS1,

    (

    select vestiging.naam, count(*) as Aantal_Inc_Portal

    from incident,...

    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: putting two select statements together as two columns in a resultset

    another way to do it wiht a CASE statement, if you need to do lots of different race codes:

    SELECT

    SUM(CASE WHEN race_code = '01' THEN 1 ELSE 0...

    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: putting two select statements together as two columns in a resultset

    it's suprisinglyy easy... you just need to use the two tables as aliased subselects:

    SELECT ALIAS1.AM,ALIAS2.CM

    FROM

    (SELECT COUNT(*) AS AM

    FROM dwh_test.dim_employees

    WHERE

    ...

    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: How to get a count of occurences of a string within multiple substrings

    the trick for # of recurring substrings in a string is to use the replace function:

    declare @MySchedule varchar(168)

    SET @MySchedule = REPLICATE('123456789',40) --overkill

    select @MySchedule

    /*results:

    123456789123456789123456789123456789123456789

    123456789123456789123456789123456789123456789

    123456789123456789123456789123456789123456789

    123456789123456789123456789123456

    */

    --how many times is there a 9 in...

    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: Calling Stored procedure at specific time

    again, I call BS.

    what possible business process needs to scan the table every 30 seconds? how often is the table queried against per second? you've explained just fine what you...

    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: View and SQL2000 performance

    When it comes to beating a dead horse with management, I've been there as well....sometimes they don't want to listen.

    What is the real issue by the way? cursors? we might...

    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: Database Migration from 2000 to 2005

    steveb's suggestion is the best, bar none. copy database wizard is not reliable compared to the built in ability of a SQL 2005 server to update an existing 2000 MDF...

    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: Trigger problem

    for a trigger to be handled correctly, you cannot declare variables....

    you have to keep everything SET based.

    once you declare a variable, you are telling me you are thinking of one...

    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: Using text data type in sql server 2000

    you can do it in 8000 char bites. the NULL parameter in your original statement below is WHERE to insert more text in the text field, and thenext parameter...

    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: How to avoid Table scan from temp db

    a table scan isn't necessarily evil....is the select very slow or anything?

    how many rows are in the temp table?

    what is the CREATE TABLE statement for the table?

    is there...

    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: Using text data type in sql server 2000

    you can't put a select statement there, only a string. you cannot select all columns in a table as a string...you'd have to build a string and use that.

    you'll need...

    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: Clustered Index in SQLCE?

    from what i read, you cannot create a clustered index on CE other thant eh PK of the table'http://www.developmentnow.com/g/97_2005_2_0_0_384968/Clustered-Indexes.htm

    also, CE can only use one index at any time, but i...

    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: Date value not poplating on my form

    also stating the obvious...maybe in one database, the field is not null, and the database that doesn't show the value it is null...did you query both dbs to check 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!

Viewing 15 posts - 11,581 through 11,595 (of 13,460 total)