Forum Replies Created

Viewing 15 posts - 46 through 60 (of 79 total)

  • RE: Validating Stored Procedure results

    No way to handle that in sql.

    use xp_cmdshell to exec procedure using osql or isqlw. capture results of xp_cmdshell. parse the text.

    create #t(t varchar(255), ln int identity)

    insert #t...

  • RE: Validating Stored Procedure results

    You probably weren't running from the tempdb database. Just use a full path to the table: tempdb.dbo.syscolumns.

  • RE: Importing to normalized structure

    Keep tblStage2. Add an identity column and make that the primary key. Add indexes on the columns you will need for querying - probably ip, username, division, code, date/time.

    If...

  • RE: Validating Stored Procedure results

    Use openrowset and syscolumns.

    select *

    into #t

    from openrowset('SQLOLEDB','server';'login';'password','exec tempdb.dbo.test')

    select number_of_columns = count(*) from syscolumns where id = object_id('#t')

    Assuming procedures always return only one resultset.

  • RE: Problem getting data without temp table

    It's not clear, but maybe you're asking for a simple join?

    select T1_ID, T1_COL, field1, field2, field3

    from T1 inner join F1 on (T1.T1_ID = F1.F1_ID)

  • RE: Importing to normalized structure

    I see your point and it's a good one. Do you need that functionality for date, time, and bytes?

    If you are just reporting, I'd say just use the "select...

  • RE: Importing to normalized structure

    The actual data and how it is used really determines how to structure it. Unfortunately, I'm familiar with neither.

    Just looking at the tblStage2, I see no reason to split it...

  • RE: Importing to normalized structure

    Your "normalized" table structure looks whacky.

  • RE: Importing to normalized structure

    I haven't heard of anything to automatically do that type of transformation. Forget the trigger; it just makes the work more complicated. Add some additional steps to copy data in...

  • RE: Log me, Log me not, which one

    I've done mass updates like that by using smaller batches and explicit transactions. You just need to figure out how to break up the big query into a bunch of...

  • RE: SQL problem: optimizing UNION. Is it possible?

    If your search is returning a huge resultset, I can see why the union would take so much longer than the three individual selects. The union has to get rid...

  • RE: Triggers

    You need some other unique identifier in the table. An identity column is best because no one can change it.

    If you expect only one row is updated at a...

  • RE: Column to return 2 rows

    select

    col1,

    col2 = case col2 when 'INP' then col2 end,

    col3 = case col2 when 'OVL' then col2 end

    from Table1

  • RE: Creating a 1:1 JOIN on a 1:M relationship

    Need a unique key on CustomerInfo. I'll assume it's CustInfoID. I'll also assume that the "first" record means the one with the lowest CustInfoID.

    select *

    from Customer

    left join CustomerInfo

    on (CustomerInfo.CustID =...

  • RE: Image datatype

    Your question is too general. There are a great many ways to do what you ask. Specify your client environment, where do the images come from and where will they...

Viewing 15 posts - 46 through 60 (of 79 total)