Broken Subscriptions Due To Empty Table
Jul 31, 2007
Hi,
I was wondering what the best way was to deal with subscriptions breaking due to an empty table. I have subscriptions that people have scheduled to go out daily, but on certain days the table may be empty, in this case the subscription doesn't read the parameters for the report and then the subscription breaks.
My original solution involved creating a #temp table with the same columns as the original table and inserting one row into it which I'd union with the original table, this row in the temp table had all its values set to 0. The solution worked when I ran it in SQL Server Management Studio but it seems SRS doesn't like the INSERT INTO statement, which is the error I get, but I've read on these forums that it doesn't like #temp tables either. I proceeded to use a stored procedure with all the code in it, but I might have trouble filtering on multi value parameters, because at times these parameter lists get real big, plus I have to do this for multiple reports and don't want to get into creating stored procedures for each report.
Following is what the code I used look something like that executes and does the job in Management Studio but not SRS. I'm mainly just looking for the easiest and cleanest way to do this, since it'll have to be done across multiple reports, so disregard the code if there's an easier way to do it. Thanks in advance.
create table #dummytable
(
name varchar(35),
country varchar(35),
idnumber (int)
)
GO
insert into #dummytable (name),values('0');
select name, country, idnumber
from originaltable
where name in (@name)
union
select name = 0, country = 0, idnumber = 0
from #dummytable
drop #dummytable
View 4 Replies
ADVERTISEMENT
Sep 5, 2007
Hi,I am studying data mining features of SSAS and for a workshop I'vecreated 2 views derived from vTargetMail view of AdventureWorksDW.Train data consists every record except those in Pacific, and testview consists only records from Pacific area.1. I've created a mining structure based on Decision Tree and selectedBikeBuyer as predictable column.2. According to input column suggestions, I've selected Age,Eng.Education, NumberCarsOwned, YearlyIncome, CommuteDistance,NumberChildsatHome and TotalChildren as input columns,3. I've modified no other setting, and deployed project.I can get training results in decision tree browser and dependencynetwork (and both seem to give rather logical results) however, when Itry to browse lift chart or classification matrix I get an emptyclass.matr. and a lift chart of a single 45 degree line.Am I missing a step, or must I do some fine-tuning on (what)parameters?Thanks...
View 2 Replies
View Related
Sep 5, 2007
Hi,
I am studying data mining features of SSAS and for a workshop I've
created 2 views derived from vTargetMail view of AdventureWorksDW.
Train data consists every record except those in Pacific, and test
view consists only records from Pacific area.
1. I've created a mining structure based on Decision Tree and selected
BikeBuyer as predictable column.
2. According to input column suggestions, I've selected Age,
Eng.Education, NumberCarsOwned, YearlyIncome, CommuteDistance,
NumberChildsatHome and TotalChildren as input columns,
3. I've modified no other setting, and deployed project.
I can get training results in decision tree browser and dependency
network (and both seem to give rather logical results) however, when I
try to browse lift chart or classification matrix I get an empty
class.matr. and a lift chart of a single 45 degree line.
Am I missing a step, or must I do some fine-tuning on (what)
parameters?
View 3 Replies
View Related
Jul 20, 2005
I am using SQL Server 2000, SP3.I created an updatable partitioned view awhile ago and it has beenrunning smoothly for some time. The partition is on a DATETIME columnand it is partitioned by month. Each month a stored procedure isscheduled that creates the new month's table, and alters the view toinclude it. Again... working like a charm for quite some time.This past weekend I moved some of the first tables onto a new filegroup. I did this through Enterprise Manager, by going into designmode for the table, then going into the properties for the table andchanging the file group there as well as in all of the indexes. Nowthe partitioned view is no longer updatable. It gives the errormessage: "UNION ALL view '<view name>' is not updatable because apartitioning column was not found."I have extracted the DDL for all of the partition tables and comparedthem and they all look the same. I checked and then double-checked theCHECK constraints to make sure that they were all valid and they are.If I remove the tables that I moved to the new file group from theview, then it is once again updatable, but when I put them back in itfails again.Any ideas? If you would like samples of the code then I can send italong, but it's rather large, so I have not included it here.Thanks!Thomas R. Hummel
View 3 Replies
View Related
May 16, 2007
Greetings,
We periodically get the following message in our three server peer-to-peer transactional replication environment:
"One or more subscriptions have been marked inactive. Drop and re-create all subscriptions for this node that are failing with this error."
What causes a subscription to be marked inactive? What properties or settings can be adjusted to minimize or eliminate this occurrence?
Everthing seems to be running OK and then we get the message. It afflicts the higest change volume publication on our slowest overseas server.
Thanks,
BCB
View 9 Replies
View Related
Jan 18, 2007
I doubt this is possible, but can someone think of a way to change the email address used for sending report subscriptions based on the report or subscription?
It's a need that I've heard from a number of different clients. Scenario: a company has one reporting services server with reports running from numerous departments. Report subscriptions are sent to internal and external email addresses and there's a business need to use different "from" addresses based on the report (or audience).
View 1 Replies
View Related
Apr 10, 2007
The Description field in SQL Server 2005 Reporting Services just defaults to "Send e-mail to email@domain.com" (obviously a dummy e-mail address) when you create an e-mail subscription. You cannot edit the Description when you select "Edit" beside a subscription.
The Description may be edited directly in the Subscriptions table under the ReportServer database but this is not end-user friendly.
I thought of using an add/update trigger to set the Description to the "Subject" out of the Extension Settings field. The Extension Settings field is XML so you would have to parse the Subject out of there first. The "Subject" is the e-mail Subject for the e-mail that is sent to the subscriber and it much more adequately describes the report.
My boss understood what I wanted to do but wanted to make sure in the industry literature that the product was not that lacking. Hard to believe that you cannot directly edit the Subscription Description through the web browser interface - would love for someone to prove me wrong.
View 5 Replies
View Related
Mar 23, 2004
Hi all,
I'm admitedly a bit new to the world of replication, so please bear with me. I've got two SQL Server 2000 servers running in different locations. Server A does transactional replication over a push subscription to server B. If I need to make a minor change to one of the replicated tables (for example, dropping a no longer used column or changing a varchar field's length) do I need to drop the subscription, make the changes and then re-initialize the schemas and data?
For minor changes, I really hate having to knock out the site runnign off server B while the subscription is re-initialized and data is bulk copied back over. If I want to just make the changes manually on both servers will that cause problems down the line?
Any help is greatly appreciated.
tia.
-m
View 2 Replies
View Related
Jul 22, 2012
All, Using access 2003 frontend and sql server 2008 backend. I have an append query to insert 80000 from one table to an empty table. I get an error:
"Microsoft Office Access set 0 field(s) to Null due to a type conversion failure, and didn't add 36000 record(s) to the table due to key violations, 0 record(s) due to lock violations, and 0 record(s) due to validation rule violations."
I know this error normally comes if there are dups in a field that doesnt allow.
View 1 Replies
View Related
May 14, 2007
hi everyone,
i was just wondering, is there anyway to empty a table...like, in mysql u can go EMPTY TABLE
and it resets the identity stuff, so your id's start at zero again...?
Thanks, Justin
View 4 Replies
View Related
May 16, 2007
I am creating three tables in a DataSet using three stored procedures and I need a way to know that either the tables have at least one row or preferably which if any has no rows. How can I do that?
using three SP's, one for each table:SqlCommand cmd = new SqlCommand("CompanyCheck", con);SqlCommand cmd2 = new SqlCommand("ContractorVerify", con);SqlCommand cmd3 = new SqlCommand("StoreLocation", con);
cmd.CommandType = CommandType.StoredProcedure; cmd2.CommandType = CommandType.StoredProcedure; cmd3.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CompanyID", CompanyID); cmd2.Parameters.AddWithValue("@CompanyID", CompanyID); cmd3.Parameters.AddWithValue("@CompanyID", CompanyID); SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd; DataSet ds = new DataSet(); try { da.Fill(ds, "CompanyInfo"); da.SelectCommand = cmd2; da.Fill(ds, "ContractorInfo"); da.SelectCommand = cmd3; da.Fill(ds, "StoreInfo"); } catch { throw new ApplicationException("Data error"); } finally { con.Close(); }
Thank you
View 2 Replies
View Related
Sep 10, 2001
I have a particular production database that on a few recent occasions has suddenly had one of it's tables empty of content. Now there are no jobs or triggers in place neither is any stored procedures that could perform a delete or alter table operation in place. The permissions have been set not to allow this either. The datatype is text only. What is intriguing is the QA server has an exact mirror and this dosen't happen. Has anyone come across this sort of phenomenon?
View 2 Replies
View Related
Mar 1, 2000
I can use the Design Table option in every database and any user table on my server except for two databases which were transfered from a SQL 6.0 server.
I can't even use Design Table to create a new table in these databases. I get the Design form up and it allows me to add columns, but when I try to save the changes I get the following error message:
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'full'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'full'.
One thing I have noticed is under Users for the database, all my users come up as 'via group membership' for the Database Access column for the database I am having problems with. All other databases the users come up as 'Permit' for the Database Access column. I assume this has to do with security. But I have tried everything to change this. I can not get a user to come up as 'Permit' under these two converted databases.
Does anyone have any ideas?
View 1 Replies
View Related
Jul 15, 2004
I'm running SQL 2000 (SP3) on top of Windows NT 4.0 (SP6).
I have a couple of processes that look at the sysperfinfo table every day to collect some performance/metric type information. It works for all my other servers (mostly SQL 2K/Win2K) except for this one.
Why is the table on this one server empty?
I do have one other SQL 2K/Win NT server. The sysperfinfo table on that one is fine.
the only other clue/difference is that the server which has the empty table is a named instance install of SQL 2K.
Any hints?
Regards,
hmscott
View 2 Replies
View Related
Nov 15, 2006
Hi,
i wanna know how can i check a table has datas inside, because i wanna use delete from table and if table is empty i dont wanna run this statement.
thanks in advance
View 5 Replies
View Related
Sep 18, 2005
Hi,can somebody explain me, why the IDENT_CURRENT from an empty table is 1?After insert of the first record it is still 1 (assuming that start valueis 1) which is okay. But if i check the IDENT_CURRENT from a newly createdtable the result should be NULL, or not?bye,Helmut
View 10 Replies
View Related
Apr 25, 2014
I have a query
select salesId,count(*) from salesline group by salesid
Result will be
salesid Nos
----- ---
SO001 2
SO002 4
I want to display single record like below if there is no record available in the table
salesid Nos
So00? 0
View 1 Replies
View Related
Sep 10, 2007
Hi,
I want to use something like select count(*) from table name = 0; to check whether a table is empty,
is this possible?
Thanks for any info.
Al.
View 4 Replies
View Related
Oct 25, 2007
Hey
Is it possible to search for a column without a value?
$query="select id from table1 where col2=''"; (this didnt work, but how do I do it??)
I need the id for the row that has the col2 empty.
:)
View 13 Replies
View Related
Jul 20, 2005
In Access I have a macro that, each night, takes a table with aprimary key defined in it, and deletes all the rows. Then itimports/appends records from a fixed width text file. In this way,since the table is not deleted and recreated, the primary key is keptintact.What would be the equivalent SQL method for doing this in an automatedway? I've tried letting DTS import the table from Access, but theprimary key is lost. Is there some way to "empty" a table instead ofdropping it, and then append new records so that the table will end uphaving the primary key I want it to have?Thanks.Larry- - - - - - - - - - - - - - - - - -"Forget it, Jake. It's Chinatown."
View 4 Replies
View Related
Mar 3, 2008
When i try to insert new rows using SSIS into an emty table in my database, SSIS freezes. The same happens when i use a lookup on an empty table.
The only solution i have found is to manualy insert a row and remove it afterwards. When i have done this SSIS works without a glitch.
I start off by taking a script of a existing database and applying this script on a new database. So that i create an empty duplicate of my current database.
Any ideas why SSIS freezes? Do i have to initialize something first in my database? It is really annoying that i have to insert a row and delete a row into every table i want to use.
View 9 Replies
View Related
Jan 28, 2008
Hi,
I'm using the Business Intelligence Studio for designing reports in VS2005 with SQL-Server 2005 Standard used on a TFS server.
On my report I have several tables each related to a previously defined dataset. Now, if a dataset returns no data, I would expect, that the table shows the header but no rows. This is true, if the table is located on the first page of the report and used directly in the preview tab of a report project. If such a table is located on following pages, I get an rsInternalError when switching to the second page. Trying to export the report, e.g. pdf, directly results in this error. When trying to view the report on the report server, the error appears also at once.
If, in Visual Studio, clicking on the button "page layout" everything is fine: empty tables are shown correctly.
How can I avoid this error in my reports? I would like to publish my report (no fancy stuff, just simple text data), possibly containing empty tables, on the server that all team members can view it - without the error...
Thanks in advance,
Erik Steiner
View 3 Replies
View Related
May 12, 2015
I am trying to work with a developer test a code change in their application. The db basically has a workload table and as it finishes processing each row in the table, it gets deleted from the table. I want to monitor when the db becomes empty/no rows in it to test how much the code changes have worked, how long does it take to process all rows in the table. Any quick way to do it at the db level instead of having to put something in the code just for this testing.
View 4 Replies
View Related
Nov 5, 2007
How do I go about iterating through every table in my database and empty each table so they contain no data?
I don't want to drop the tables and re-create them either.
Thanks.
View 6 Replies
View Related
Apr 20, 2008
Hello,I'm a beginner in SQL and I have been searching through the SQL Cookbook and Google but I can't seem to find an example of what I want to do. I want to create a report that will return names and emails using two of my tables. I want to use the email in my primary table in the select but if it is null or empty I want to replace it with an email from my secondary table. Below is what I would like to do but I got a syntax error with it in SQL Server 2000. SELECT MemberID As ID, MemberFirstName As FirstName, MemberLastName As LastName, (IF MemberEmail = '' THEN SELECT TOP 1 OtherEmail FROM OtherTable WHERE OtherID = MemberID) As EmailFROM PrimaryTableThanks for your time.Jason
View 8 Replies
View Related
Jan 15, 2015
I have a column within a table which is already truncated/deleted all records within (Microsoft SQL 2008). I have to now populate the column with sequential numbers up to 50,000 records arbitrary numbers (doesn't mater) up to 7 characters.
what SQL statement I need to write that will automatically polulate the newly empty table with A000001,A0000002,A0000003, or any form for that matter etc so that I can sort number the records within the table.
I have approximately 50000 records which I need to sequentially entered and I really dont want to number the column manually via hand editing.
View 5 Replies
View Related
Aug 18, 2007
Hi, is there a way I can check if a table is empty and contains norows?I have a Table1 which being dynamic can sometimes end up with nowcolumns what so ever. I'm using Table1 in one of my views along with 2other tables and I would like put a condition at the...something likeAND Table1 IS NOTEMPTYIs there a way to do this in MS SQL?Many thanksYas
View 7 Replies
View Related
Aug 9, 2013
I want to check if a table is empty using query code?
How to do this?
View 4 Replies
View Related
Nov 20, 2007
I've built a simple VS2005 ASP.Net web app that uses Crystal Reports for generating assorted reports. More specifically, when a report is called it executes the correct SQL Server Stored Procedure and returns a Data Table populated with with appropriate data. In my testing, everything seemed to be working fine.But I just did a test where I pressed the "Submit" button on two different client browsers at almost the same time. Without fail, one browser returns the report as it should but the other one returns an empty report; all of the Crystal Reports template info is there but the report is just empty of data. Considering that each browser is running in its own session, I'm confused about why this is happening.One thing: I did login as the same user in both cases. Might this be causing the problem?Robert W.Vancouver, BC
View 7 Replies
View Related
Sep 22, 2014
I am inserting the following columns from one table to another,
SalesOrder,Customer,CustomerPoNumber,ShippingInstrs,CustomerName,ShipAddress1,ShipAddress2,ShipAddress3
How do I make sure that all empty spaces are trimmed.
View 2 Replies
View Related
Jul 6, 2006
Hi all,
In BOL it says: "The Lookup transformation performs an equi-join between values in the transformation input and values in the reference dataset. Using an equi-join means that each row in the transformation input must match at least one row from the reference dataset. If there is no matching entry in the reference dataset, no join occurs and no values are returned from the reference dataset. This is an error, and the transformation fails, unless it is configured to ignore errors or redirect error rows to the error output. "
I have a lookup transformation which is supposed to find a match on two fields in the reference dataset (a table in my case) but strangely, when I execute my package and the reference table is empty the lookup still finds match for each row of my input dataset.
Does anyone have an idea why? I could'nt find anything about that in BOL.
Sébastien.
View 4 Replies
View Related
May 22, 2001
Hi, I wanted to create an exact database in another server, so I generated script of all tables,views, store procedures and ran the script on the new server. I was able to have all objects in the new server.
but when I run the following sql from sql query analyser, I get nothing in return. What do I need in order to get a valid response.
Ali
/*Truncate from all tables*/
select 'Truncate table ' + name from sysobjects where type ='u'
order by name
/*Count all table rows from all tables*/
select 'select count(*) as ' +''+ name + ' from ' + name from sysobjects where type ='u'
order by name
/*View all sp*/
select * from sysobjects where type ='p' and name
not like 'dt%'
order by name
/*View all triggers*/
select * from sysobjects where type ='tr'
order by name
/*View all Views*/
use master
select * from sysobjects where type ='v'
order by name
View 1 Replies
View Related
Dec 2, 2013
I have created some dynamic sql to check a temporary table that is created on the fly for any columns that do contain data. If they do the column name is added to a dynamic sql, if not they are excluded. This looks like:
If (select sum(Case when [Sat] is null then 0 else 1 end) from #TABLE) >= 1 begin set @OIL_BULK = @OIL_BULK + '[Sat]' +',' END
However, I am currently running this on over 230 columns and large tables 1.3 mil rows and it is quite slow. How I can dynamically create a sql script that only selects the columns in the table where there is data in a speedier manner. Unfortunately it has to be on the fly because the temporary table is created on the fly.
View 9 Replies
View Related