|
Does anyone happen to know why the column headers to do render in the
email? I have the bit set to '1' which should pass the column headers
in the attachment?
exec [msdb].[dbo].[sp_send_dbmail] @profile_name =
'dbmailden', @recipients = em...@email.com,
@subject = 'Weekly Tickets Reported in the Last 7 Days',
@query_result_width = '3250',
@query_no_truncate = '1',
@query_result_header = '1',
@query_result_separator = ' ',
@execute_query_database = 'webhelp2', @attach_query_result_as_file =
'1',
@query_attachment_filename = 'weeklyticketssummery.xls', @query = '
select count(*) as [Total Tickets Assigned]
, location_name [Cient], Priority_type_name [Priority],
SUM(CASE
WHEN DATEDIFF(DAY, Report_Date,
CURRENT_TIMESTAMP)
BETWEEN 2 AND 6
THEN 1
ELSE 0
END) AS over_2_days,
SUM(CASE
WHEN DATEDIFF(DAY, Report_Date,
CURRENT_TIMESTAMP)
BETWEEN 7 AND 14
THEN 1
ELSE 0
END) AS over_7_days,
SUM(CASE
WHEN DATEDIFF(DAY, Report_Date,
CURRENT_TIMESTAMP) >= 15
THEN 1
ELSE 0
END) AS over_15_days ,
SUM(CASE
WHEN DATEDIFF(DAY, Report_Date,
CURRENT_TIMESTAMP) >= 30
THEN 1
ELSE 0
END) AS over_30_days
from job_ticket j
inner join priority_type p on p.priority_type_id = j.priority_type_id
inner join tech t on t.client_id = j.assigned_tech_id
inner join location l on l.location_id = j.location_id
where status_type_id != 3
group by p.Priority_type_name, l.location_name'
Regards,
Hulicat
|
|
|
|
|
what does this mean "Integrity constraint violation" while trying to write data into oracle tables ?
Thanks,
Nice things do nice works
|
|
|
|
|
Well, at a guess... I would say the table you are tring to write to has constraints on it and the data you are inserting/updating violates those constraints.
See if you can get a copy of the database schema for the affected table(s) to determine how you are violating the constraint.
Tim
|
|
|
|
|
Can you post the Oracle error code ? Something like ORA-00001 ...
By having the error code, it would be easier to determine what is causing the problem.
|
|
|
|
|
There are 5 type of integrity constraints NOT NULL, UNIQUE KEY, PRIMARY KEY, FOREIGN KEY and CHECK. I think you aplied anyone of them in your table schema and voilating that. If a user tries to insert data that doesn't meet these requirements, Oracle will not allow so.
"We can't solve problems by using the same kind of thinking we used when we created them"
|
|
|
|
|
I am using SQL Server 2005 for my web application.The Database I am using is located on a remote server and I am accessing the database from my local Machine.I have used stored procedures for all the database operations.When I was running my application(On my IIS) i.e., localhost, it was working fine, so I uploaded all the compiled pages to the web server.Now the pages which don't require database operations are working fine but whenever database connectivity is required an application runtime error is occuring.Someone told me to grant permissions to the users/guests for the stored procedures and I did the same.The problem is when permission link is clicked there are 4 database objects to be selected Administrator, Dataadmin, guest and whbuser.I want to know what permissions should be given to which one?I granted permissions to first 2 objects but its still not working.What could be the solution so that the database may be used by the site's users for their respective purpose?What is the complete procedure to make a remote database work with front end successfully?Thanks..
|
|
|
|
|
zafar sultan wrote: When I was running my application(On my IIS) i.e., localhost, it was working fine
Localhost could also refer to the built in webserver inside Visual Studio. This doesn't use IIS and it will run with YOUR permission set, not that of the webserver. Are you absolutely use it is your local IIS?
zafar sultan wrote: Someone told me to grant permissions to the users/guests for the stored procedures and I did the same
Blindly granting access to stuff really blows holes in your security. Please think about what you are doing with that regard and think about what is actually happening when you do these things. If you don't understand then please get a good book on .NET web application security.
zafar sultan wrote: permission link
Permission "link"? Are you configuring your database through a web site? (e.g. Your hosting provider). If that is the case then I cannot tell you what they have set up.
What does your connection string connect to the database as? That will point you in the right direction as to what permissions you need to be changing.
zafar sultan wrote: What is the complete procedure to make a remote database work with front end successfully?
That depends on your set up.
|
|
|
|
|
I got this part message in my email...
zafar sultan wrote: No it is not the built in web server(SQLEXPRESS) that i am using i am using a remote database which I created on a remote server(from my web hosting service provider).It is created successfully and can be accesed if i use my application from my machine(localhost).The only problem is my application can not access the database when it is accesed through web browser.What could be the reason and how it can be solved?
This was my connection string
When it was not working i changed it to
But it is still no...(continued)
If you have solved your problem let others know as it helps them if they have the same problem, don't just delete messages.
|
|
|
|
|
Actually I submitted the wrong query string so I deleted the message and was trying to write the new one when the connection disturbed.Sorry for that.
This was my connection string
<connectionStrings>
<add name="myconnectionstring" connectionString="Data Source=xxx.xxx.xxx.xxx;Initial Catalog=mydatabasename;User ID=databaseuser; Password=mypassword"/>
</connectionStrings>
When it was not working i changed it to
<connectionStrings>
<add name="myconnectionstring" connectionString="Data Source=xxx.xxx.xxx.xxx;Initial Catalog=mydatabasename;User ID=databaseuser; Password=mypassword; User Instance=True"/>
</connectionStrings>
and its still not working.My problem is not solved.
And by permission "link" I mean the option given by SQL Server Management Studio(After right clicking the stored procedure and then clicking on properties)Thats where I had to provide database objects and permission for each of them(Control,Execute,Write and so on)
|
|
|
|
|
Hello All,
Can any one Help Me to resolve the Below problem.
EventID : 17809
Could not connect because the maximum no of 6 users are already been reached.the system administrator can use sp_config to increase the maximum value.
Please help me to get rid of this Problem
Thanks
riz
|
|
|
|
|
rrrriiizz wrote: Please help me to get rid of this Problem
Have you tried the suggested course of action in the error message?
The suggestion was:
SQL Server wrote: the system administrator can use sp_config to increase the maximum value.
|
|
|
|
|
I dont know How to Use this command
SP_config XX this is enough
XX -> No of users need to connect.
that is SP_config 25
But this Command is no longer Use. What can i Do Now?
Thanks
Riz
|
|
|
|
|
|
Hi All,
I am new to SSRS and I need help in getting the list of recently viewed 5/10 reports.
I want to populate the names of recently viewed 5-10 reports in a Drop Down List so that I can select one report from the Drop Down List and view it in Report Viewer. For this I want to know how we can get the list of those recently viewed reports from the Report Server.
Please suggest.
Thanks.
archie
|
|
|
|
|
Hi, I need to migrate my database from sql server 2005 to 2008.
Please provide me the steps for the same.
thanks
raj
|
|
|
|
|
|
Let me understand this, you have a job to do but you want us to do it for you.
I've got a fence to paint, anybody want to do that ?
Signed,
Tom Sawyer
|
|
|
|
|
David Mujica wrote: I've got a fence to paint
Hah. I have a house that needs painting. Wonder if the OP would be up to it
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Step 1.)Install SQL Server 2008
Step 2.)RTFM
“If we are all in agreement on the decision - then I propose we postpone further discussion of this matter until our next meeting to give ourselves time to develop disagreement and perhaps gain some understanding of what the decision is all about.”-Alfred P. Sloan
|
|
|
|
|
My date format in MS SQL is DD/MM/YYYY hh:mm:ss and it seems the calender in VS 2008 has the date format MM/DD/YYYY
So every time I try query information from my web app(using the criteria of specific periods of time using the calender object) I get bad information if any...
Any advice on how to get the two dates working correctly together...
Also, what should the standard date format be if there is one?
Thanks
|
|
|
|
|
span98 wrote: My date format in MS SQL is DD/MM/YYYY hh:mm:ss
SQL Server does not have a date format. It may display dates in a specific format and T-SQL may interpret strings in a particular format if required but SQL Server itself, internally, does not have a date format.
Your request suggests that you are not using parameterised queries. You should learn to use parameters because they will not care about date formatting so long as you tell it that a parameter is a date and you use a DateTime object in .NET. Also, parameterised queries will reduce the chances of being vulnerable to a SQL Injection Attack.
|
|
|
|
|
Can you explain the parameterised query for me? I am requesting certain data from within a table and wanting the results between 2 certain dates. So my query looks something like this:
select top (1) count([destination telephone no]), [destination telephone no]
from calls
where (Name LIKE '%' + @name + '%') AND ([DateTime] >= @start) AND ([DateTime] <= @end)
group by [Destination Telephone No]
order by count([destination telephone no])
So I am requesting the info for that specific time period. @start and @end being my controls on my .aspx side
|
|
|
|
|
@name , @start and @end are all parameters, so you are already using a parameterised query - So, I can only assume that @start and @end are the wrong datatypes otherwise you should not be getting the problem you are getting.
@start and @end should be DateTime objects on the .NET side and SMALLDATETIME or DATETIME objects on the SQL side.
|
|
|
|
|
My SQL table where the data is, has the field type DateTime. My PC language is set to UK which puts it in the format DD/MM/YYYY.
Also I have set my SQL language to British English...
"@start and @end should be DateTime objects on the .NET side and SMALLDATETIME or DATETIME objects on the SQL side. "
How do I change it on my .NET side? That might help if I can change the way the .NET is reading my date format from SQL
|
|
|
|
|
span98 wrote: How do I change it on my .NET side?
What is your existing code?
span98 wrote: That might help if I can change the way the .NET is reading my date format from SQL
The code you showed me earlier does not indicate that the .NET side is reading any dates. It is passing dates to SQL Server (i.e. it is writing dates)
|
|
|
|