Forum Replies Created

Viewing 15 posts - 31 through 45 (of 110 total)

  • RE: Database design - one db vs multiple db's for client-server app

    There are some definite advantages to the single db plan but since you already have that here are some advantages to the multiple db plan:

    Another way of saying "everything in...

  • RE: Running a SQL Server Agent job with in another job

    This may work.

    Make one new job, call it Job 0. When Job 0 runs all it does is add a new schedule or update existing ones to Jobs 1, 2,...

  • RE: enterprise manager column formula

    This way, users cannot enter anything directly into column2. Fair warning, there are times when you do NOT want computed columns.

    create table ComputedColEx

    (

    row int identity(1,1),

    co11 datetime,

    col2 as dateadd(yyyy, 25,...

  • RE: Triggers

    Sounds like you want cascading triggers or Cascading Referential Integrity Constraints. I don't have an example handy. Look at BOL and see if they really are what you want.

  • RE: Triggers

    Can you be more specific? For example, do you want the triggers to fire only when the same thing happens to two tables at the same time? Or, do you...

  • RE: Data Conversion question - bad data points

    Try IsNumeric().

    if isnumeric(@Amount) = 1

    begin

    Set @AmountFixed = Cast(@Amount as Numeric(12,2))/100

    Update #DemoTable set AmountFixed = @AmountFixed where DemoID = @ID

    end

    else

    print 'bad'

    The cursor is only for the demo, right? Otherwise, any...

  • RE: Dynamic SQL to create table variable

    That will work.

    Do you have to make or use format files too? Be sure they allow for your LoadDate and LoadTime columns. Of course, you could make the table with...

  • RE: Dynamic SQL to create table variable

    You can't bulk insert into table variables. You can bulk insert into local temp tables. That satisfies your multiple simultaneous user requirement.

    Will you at least know the names and number...

  • RE: Stored Procedure Runs complete in Query Analyzer, but not from a job step

    Is there any chance you have 2 databases, one with data and one without, and the job is using the wrong database, most likely master? The posted code does not...

  • RE: Search for specific data

    select * from #xx

    where convert(int, z1) = 1111

    and z1 like '%1111'

    will not include values like '001001111' and '1111111' because both convert to ints greater than 1111.

    Since ishaan99 did not say...

  • RE: foreign Key violation

    Apparently dtblTelephones.Code is the same thing as dtblTechnicians.Country (not obvious by the names). So, all of the country values have to be in the telphones table.

    If this is an exceptional,...

  • RE: Search for specific data

    Try this:

    create table #xx (z1 varchar(10))

    insert into #xx

    select '00070111' union all

    select '0001111' union all

    select '00000111' union all

    select '00040111' union all

    select '00044111' union all

    select '000001111'

    select * from #xx

    where convert(int, z1)...

  • RE: Count Number of Views in a Database

    Your USE command affects only the dynamic sql's connection so you have to do all of your counting in the dynamic sql. Like this:

    USE master

    DECLARE @DatabaseName VARCHAR(50)

    CREATE TABLE #DatabaseOutput

    ...

  • RE: Using INNER JOINS as a filter technique, where should I index?

    What does your execution plan show? Is there an table or index scan on Sales_Summary?

    Even though you have an index on each of the filter fields in the fact table...

  • RE: Stored Procedures - Must declare the scalar variable "@TempTable"

    SELECT @TempTable.*, tblServersAddresses.IPAddress

    FROM @TempTable

    LEFT JOIN tblServersAddresses

    ON @TempTable.srvID=tblServersAddresses.srvID

    Alias the table variable like this

    SELECT tt.*, tsa.IPAddress

    FROM @TempTable tt

    LEFT JOIN tblServersAddresses tsa

    ON tt.srvID=tsa.srvID

Viewing 15 posts - 31 through 45 (of 110 total)