Showing posts with label input. Show all posts
Showing posts with label input. Show all posts

Monday, March 26, 2012

Problem in Creating AFTER INSERT Trigger

I am trying to create a AFTER INSERT Trigger. I created it and it worked for one record. But when I am trying to input multiple inserts it gives me error even on my insert statement. I am sure the syntax is right. Can anyone confirm this syntax. When I created a small table for testing this syntax worked... I dont know why its not working here.

INSERT INTO media (
media_name,
description,
active_flag,
activity_log,
data_entry_status_code,
category_id,
vendor_id,
created_by,
created_date
)
VALUES
('Test Media20', 'Test Description20', 1, 'Test Log20', 1, -1,-1, -1,'1/1/2001 12:00:00 AM'),
('Test Media21', 'Test Description21', 1, 'Test Log21',1, -1,-1,-1,'1/1/2001 12:00:00 AM'),
('Test Media22', 'Test Description22', 1, 'Test Log22',1, -1,-1,-1,'1/1/2001 12:00:00 AM')It is an insert statement.
Show me trigger text, please and what error messages you have if any.|||Also what is table [media] definition?
I mean show me datatypes of your columns.sql

Friday, March 23, 2012

Problem importing from Oracle

Hello all, I hoping to get some input on how to get around this odd problem. I use the SSIS Import Wizard to create a package that imports data from an Oracle 9 database into SQL 2005. One of the 'columns' selected from Oracle is actually two floating point columns multiplied together.

ie: SELECT one * two FROM table

In the SSIS wizard the data preview for this shows up as it should, with the column data in floating point form. However after actually importing the data, all the numbers get imported as integers even though they are going into a floating point column.

Any ideas how to get around this?

Thanks

Try explicitly casting them as a float in the SELECT.

Wednesday, March 7, 2012

Problem creating report with Table having dynamic columns.

The requierment is tyo have a dynamic report, that has a table with number of
columns decided on the input from recordset.
The SQL procedure takes in parameters and returns recordset, that can have
varying number of columns. All we want to do is to link this recordset to a
table on the report.
The report table should show the columns as they are in the Recordset. ( and
the column name in the recordset shall appear as the column header in the
Reporting table.)
-- Alok Kumar GuptaWhat you could do in this case is make the SP return a
fixed number of records all the time and return zero
values for the column not required.
Then map all the fields to columns in a table and set
visibility expression for columns to the appropriate
condition.
>--Original Message--
>The requierment is tyo have a dynamic report, that has a
table with number of
>columns decided on the input from recordset.
>The SQL procedure takes in parameters and returns
recordset, that can have
>varying number of columns. All we want to do is to link
this recordset to a
>table on the report.
>The report table should show the columns as they are in
the Recordset. ( and
>the column name in the recordset shall appear as the
column header in the
>Reporting table.)
>-- Alok Kumar Gupta
>.
>|||I have the same issue but my columns are being generated dynamically by user
data and I have no way of knowing how many there will be nor the names.
"Alok" wrote:
> I thought of that, but that seems to be a very crude way of achieving it.
> Doesn't the reporting service supports something like a grid to simply
> display what you get from the recordset.
> Another problem I found in the approach is about the column headers in the
> table.
> I could not write an expression for the column headers in the Table that
> could read the column titles in my recordset.
> thanks for your response.
> Alok
>
> "anonymous@.discussions.microsoft.com" wrote:
> > What you could do in this case is make the SP return a
> > fixed number of records all the time and return zero
> > values for the column not required.
> > Then map all the fields to columns in a table and set
> > visibility expression for columns to the appropriate
> > condition.
> > >--Original Message--
> > >The requierment is tyo have a dynamic report, that has a
> > table with number of
> > >columns decided on the input from recordset.
> > >
> > >The SQL procedure takes in parameters and returns
> > recordset, that can have
> > >varying number of columns. All we want to do is to link
> > this recordset to a
> > >table on the report.
> > >
> > >The report table should show the columns as they are in
> > the Recordset. ( and
> > >the column name in the recordset shall appear as the
> > column header in the
> > >Reporting table.)
> > >
> > >-- Alok Kumar Gupta
> > >.
> > >
> >