Friday, February 24, 2012
Can I Update a SQL Database...
is using to let us know when an invoice has been printed, and we'd like to
flag that specific invoice (or set of invoices). Is this possible?
I had thought about creating a stored procedure that gets called that really
doesn't return any required data, but could update the db, or custom code.
What would be the better approach? I've never connected/written to a db via
custom code before so any articles/samples you may know about and can provide
links to would be greatly appreciated.
Michael COn Oct 11, 11:44 am, Michael C <Micha...@.discussions.microsoft.com>
wrote:
> We have a SSRS report that needs to update a specific table in the SQL db it
> is using to let us know when an invoice has been printed, and we'd like to
> flag that specific invoice (or set of invoices). Is this possible?
> I had thought about creating a stored procedure that gets called that really
> doesn't return any required data, but could update the db, or custom code.
> What would be the better approach? I've never connected/written to a db via
> custom code before so any articles/samples you may know about and can provide
> links to would be greatly appreciated.
> Michael C
I have to agree that the idea you mentioned would be the best
alternative for performance and ease of change; however, if you want
to go the custom code route, here's a link that might be helpful.
http://msdn2.microsoft.com/en-us/library/ms155798.aspx
Of course, you would place the custom code in Layout view >> Report
drop-down >> Report Properties... >> Code. As far as I know, it
accepts pretty standard VB.NET code w/a few minor limitations. Hope
this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Thanks E!
As it turns out (I guess I miss understood the request) I need to try and
capture only the ones that are actually sent to the printer! Now I'm back to
square one with no idea how I'm going to do that. Any suggestions of how to
capture a print command in SSRS?
Michael C.
"EMartinez" wrote:
> On Oct 11, 11:44 am, Michael C <Micha...@.discussions.microsoft.com>
> wrote:
> > We have a SSRS report that needs to update a specific table in the SQL db it
> > is using to let us know when an invoice has been printed, and we'd like to
> > flag that specific invoice (or set of invoices). Is this possible?
> >
> > I had thought about creating a stored procedure that gets called that really
> > doesn't return any required data, but could update the db, or custom code.
> > What would be the better approach? I've never connected/written to a db via
> > custom code before so any articles/samples you may know about and can provide
> > links to would be greatly appreciated.
> >
> > Michael C
>
> I have to agree that the idea you mentioned would be the best
> alternative for performance and ease of change; however, if you want
> to go the custom code route, here's a link that might be helpful.
> http://msdn2.microsoft.com/en-us/library/ms155798.aspx
> Of course, you would place the custom code in Layout view >> Report
> drop-down >> Report Properties... >> Code. As far as I know, it
> accepts pretty standard VB.NET code w/a few minor limitations. Hope
> this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>
Tuesday, February 14, 2012
Can I Query A Temporary Table?
I have a job that has been running for years. All of sudden I see
that it's hanging, but not outright failing. I can pinpoint a
specific SP that runs and about how far it gets. It creates a
temporary table which then gets data selected into it and then does
work based on that. I can see that the temp table is created and I've
run the select into query myself and there don't seem to be any
issues. The one thing I can't tell is if there is any data in that
temp table. Is there anyway to query the table or even get
information about how many rows are in it?
Thanks,
BillIs it a global temporary table? If it's a global one, you can simply query
it using SELECT with another session.
If it's a local temporary table, then only one session can reach it, the one
which created it.
However, this temp table will be droped automatically when its owner's
session is closed whether it's glocal or local.
You can find more information about temp tables from the following link:
http://msdn2.microsoft.com/en-us/library/ms174979.aspx
--
Ekrem Önsoy
http://www.ekremonsoy.net , http://ekremonsoy.blogspot.com
MCBDA, MCITP:DBA, MCSD.Net, MCSE, MCBMSP, MCT
"zinck74" <bkelly3@.gmail.com> wrote in message
news:1193936161.327854.167670@.k35g2000prh.googlegroups.com...
> Hi,
> I have a job that has been running for years. All of sudden I see
> that it's hanging, but not outright failing. I can pinpoint a
> specific SP that runs and about how far it gets. It creates a
> temporary table which then gets data selected into it and then does
> work based on that. I can see that the temp table is created and I've
> run the select into query myself and there don't seem to be any
> issues. The one thing I can't tell is if there is any data in that
> temp table. Is there anyway to query the table or even get
> information about how many rows are in it?
> Thanks,
> Bill
>|||Yeah, unfortunately it's local table. I can see it in the list of
temporary tables in tempdb, but I can't get any stats on it. It seems
like there should be some way to get the stats somehow. Anyone else?
If anything I'd just like to be able to see the number of rows
Thanks,
Bill
On Nov 1, 11:16 am, Ekrem =D6nsoy <ek...@.btegitim.com> wrote:
> Is it a global temporary table? If it's a global one, you can simply query
> it using SELECT with another session.
> If it's a local temporary table, then only one session can reach it, the =one
> which created it.
> However, this temp table will be droped automatically when its owner's
> session is closed whether it's glocal or local.
> You can find more information about temp tables from the following link:h=ttp://msdn2.microsoft.com/en-us/library/ms174979.aspx
> --
> Ekrem =D6nsoyhttp://www.ekremonsoy.net,http://ekremonsoy.blogspot.com
> MCBDA, MCITP:DBA, MCSD.Net, MCSE, MCBMSP, MCT
> "zinck74" <bkel...@.gmail.com> wrote in message
> news:1193936161.327854.167670@.k35g2000prh.googlegroups.com...
>
> > Hi,
> > I have a job that has been running for years. All of sudden I see
> > that it's hanging, but not outright failing. I can pinpoint a
> > specific SP that runs and about how far it gets. It creates a
> > temporary table which then gets data selected into it and then does
> > work based on that. I can see that the temp table is created and I've
> > run the select into query myself and there don't seem to be any
> > issues. The one thing I can't tell is if there is any data in that
> > temp table. Is there anyway to query the table or even get
> > information about how many rows are in it?
> > Thanks,
> > Bill- Hide quoted text -
> - Show quoted text -
Friday, February 10, 2012
Can I load only specific rows of data?
Is there a way to load only specific rows of data into a table in a SSIS package?
I am copying data from 2 separate ingres databases tables that have the same table structure into one SQLServer table using the ADO.NET DataReader Source for ODBC.
Let's say table1 from db1 and table2 from db2 for example.
table1 in db1 contains two rows:
MemberID - 1
Name - Rob
MemberID - 2
Name - James
table2 in db2 contains one row:
MemberID - 1
Name - Rob
MemberID - 2
Name - JAMES
I would like my SSIS job to load all data from table1 in db1 and then only load the data from table2 in db2 where the data in the row is different (as in 'JAMES').
Is there a data flow transformation that can help me do this?
I previously did this in 2000 DTS but had to load the data into 2 separate 'holding' tables and use T-SQL to update the table1 in db1 and was hoping I cuold cut out these steps in SSIS.
I was hoping that SSIS might have some new quick way to do this (lookups maybe?)
Can you help? Thank You
You can use the Lookup transform or the Merge Join transform. T-SQL is still a valid option if it works best for you.Jamie did a nice comparison here-
Get all from Table A that isn't in Table B
(http://www.sqlis.com/default.aspx?311)|||Thank you
I shall have a read of the article and give it a try