Query That Adds Data For Every User
Feb 13, 2007
Dear Masters;
I have a Messages table; I use this table to post System Messages to my users. But what I don't know is how can I add data for multiple users. I mean I want to add same message for multiple users (ex: Please update your infos). In the belove table I have some messages for users 100 and 200; How can I add same (please update your infos) messages to both users?
Ex: Messages Table
ID UserID Msg
1 100 "Hello"
2 100 "Hi"
3 200 "Hello"
Thanks..
View 8 Replies
ADVERTISEMENT
Oct 3, 2006
I'm hoping someone can get me pointed in the right direction
we have SQL 2005 and I need to add a user account to let some only view the data
no edits / adds / deletes ?
can any one help
thanks
David
View 5 Replies
View Related
Feb 5, 2015
I have this update statement I am trying to use, to update a table. My problem is if there is no data in the select statement, it still adds number to the columns. How can I have this update statement work to put blank value in if there are no counts?
UPDATE T_AXA_BreakDown_Claims
SET [Claim Count Conm] = t2.[Claim Count Conm]
FROM T_AXA_BreakDown_Claims t1
INNER JOIN
(select
[code]....
View 2 Replies
View Related
Nov 22, 2007
Hello,
I have a report in wich I show a list of countries. The length of this list differs each month and comes from a SSAS datasource.
I want to show this list on my report in a matrix like this:
country1 country6 country11
country2 country7 country12
country3 country8
country4 country9
country5 country10
How can I do this? I need some sort of check that counts the number of countries added and then adds a new column after 5 countries.
I'm sure there is somebody that did this or knows how to do this.
Thanks in advance!
Jorg.
View 3 Replies
View Related
Dec 7, 2006
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee
View 3 Replies
View Related
Sep 21, 2007
OK, I'm new to Excel 2007 but have used excel for a long time. I have a column of numbers and I'm trying to add them up. I click Sum, I highlight to cells I want to add and hit enter and it comes up with zero. The formula looks fine =SUM(G125:G127) and there are numbers in those cells (that don't add to zero) but it keeps adding them to zero. Can someone tell me why before I put my fist through my monitor?
When I go in and just click on once cell and then hit + and then another and + and another and + and then hit enter, I get #VALUE. So there must be something about how the numbers in the cells are formatted?? They look like numbers to me?
Thanks, Peter
View 2 Replies
View Related
Dec 31, 2003
I have a page that is supposed to add a year to a record when it loads. The problem is that it adds 2 or three years instead.
Here is the page_load event:Sub page_load(sender as object, e as eventargs)
Try
Dim connection As SqlConnection = new SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim command As SqlCommand = new SqlCommand("Updateexpiredate", connection)
command.CommandType = CommandType.StoredProcedure
Dim param0 As SqlParameter = new SqlParameter("@memberid",SqlDbType.Int)
param0.Direction = ParameterDirection.Input
param0.Value = memberid
command.Parameters.Add(param0)
connection.Open()
command.ExecuteNonQuery()
connection.Close()
myerror.Text = "Thank You! Your account was updated"
Catch ex As Exception
myerror.Text = ex.Message
End Try
End SubAnd here is the SPROC:CREATE PROCEDURE Updateexpiredate
(
@memberid int
)
AS
UPDATE
members
SET
expiredate=(dateadd(year,1,expiredate)) <--I also tried expiredate=(dateadd(month,12,expiredate)) with the same results
WHERE
memberID = @memberID
GO
View 4 Replies
View Related
Nov 9, 2007
We host our reports in an ASP.NET page using a rsweb:reportviewer control. This is contained within a frameset in the web site. I've created a "Jump to URL" on a report field from this report to another page hosted on the same site. This works, but the problem is that the report gets rendered with a hyperlink that has a TARGET="_top" attribute in it. Is there any way to override this. This pops out of the frameset because of this.
Thanks.
View 7 Replies
View Related
Jan 31, 2014
We are to write a script that adds an index to a particular table/field.This is different than a query, correct? How to I simply (manually) create a script? I you can right click on the database - Tasks - Generate Scripts, but that seems to generate a lot of fluff. I also seen the option to right click on the specific table and Script Table As, however Alter To is not available.
View 2 Replies
View Related
Apr 20, 2015
=Sum(Fields!balance_due.Value)
Customer Name Balance Due
1001 Bob 100.99
1002 Jim 10.95
1003 Kim -12.67
1004 Lisa 13.23
Total $137.84
It should be like this:
Customer Name Balance Due
1001 Bob 100.99
1002 Jim 10.95
1003 Kim -12.67
1004 Lisa 13.23
Total 112.5
How can I get SSRS to add and subtracted numbers.
View 10 Replies
View Related
Dec 6, 2013
I would like to know if there is a way to find out who changed a users roles/access WITHOUT using the audit function. For example, if a user account was created and given SA access then changed to read only, how can I find out who made that change? I tried searching for an answer, but kept getting no results. I'm thinking this may tie into the sys.sysusers view?
View 3 Replies
View Related
May 17, 2006
Hi all,
Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.Here is my code and i am using windows authentication:
<%@ Import Namespace="System.Data" %><%@ Import Namespace="System.Data.SqlClient" %>
<%
Dim connAkaki As SqlConnection Dim cmdSelectAuthers As SqlCommand Dim dtrAuthers As SqlDataReader connAkaki = New SqlConnection("Server=.SQLEXPRESS;database=akaki") connAkaki.Open() cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki) dtrAuthers= cmdSelectAuthers.ExecuteReader() While dtrAuthers.Read() Response.Write("<li>") Response.Write(dtrAuthers("Firstname")) End While dtrAuthers.Close() connAkaki.Close() %>
View 2 Replies
View Related
Apr 28, 2008
Hi all hope some one can help - please bear with me new to this
Basically I have had to change pc's so I copied and pasted my ASPNET.MDF and LDF from my old pc to new PC including webpages/apps etc.. created.
However now all I get is "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path """"
Just don't understand what permissions the db should have, does it need to match the SQL Express owner...
any help would be most appreciated
Thanks
Chris
View 5 Replies
View Related
Jun 21, 2005
I installed my asp.net 2.0 web application and sql express june editon on my windows 2003 server.When the application tries to reach the database i am getting the following error"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."I can understand that it has something to do with user right but more than that I am pretty lost. Can anyone translate this error for me and give me some tips on what do to.I checked first the user running the sql express service and saw it was the NETWORK SERVICE user. I changed it to be the local system account but that did not make any difference. The application is running just fine on my local computer(Win XP sp2). This one has SQL express April edition though.
View 3 Replies
View Related
Sep 20, 2007
Hi all
Recently i was asked to design and implement an On-line WebSite for a Shop Store.I decided to define some Category for this Shop's Products such as MP3-Players,Mobiles,Televisions,Monitors and so on....and then Assign each product to a certain Category.Something like Amazon.Com , So i designed my Category and Product Table as follow:
Category Table----------------CatID int Primary-KeyCatDesc varchar(50)
Product Table-------------ProductIDProductDescCatID
After that i noticed that each category has its own Fields and Property and sometimes somecategories have common Fields for example , Price ,Color are two Common Property or Fieldsfor all Categories that i mentioned earlier But , Size is a special property for only[Monitor] or [Television] Categories and isn't useable for [Mice] or [KeyBoard] categories for example. So i Added a table for Keeping each category's Fields as follow:
Category Fields Table---------------------FieldID intCatID intFieldDesc varchar(50)FieldType tinyint --> 0=Numeric 1=String 2=Boolean...
After that i should save each Field's Value somewhere for each product so i added thefollowing Table(Product-Field-Value Table) for this purpose:
Product-Field-Value Table-------------------------ProductIDFieldIDValue
So far every thing is ok But i've faced with a new issue!!!.As you have realized so far , each productbelongs to certain category and each category has its own Fields List , in the other hand one category maybe has only 3 to 6 Fields but another Category might has 10 or more fields,So my problem here is when user wants to Add new product to Databse ,how should i get the Field's value for each product in an ASPX page ?in the other hand i'm dealing with a dynamic structure as you can see, so how should i Render the appropriate User Entries for getting Values of each product dynamically and then Saving these values in the Database? what Asp.Net Components should i use for this purpose? Could anyone help me?
Thanks in advance.Kind Regards.
View 4 Replies
View Related
Jul 13, 2015
I'm using a legacy application built using VB5 and SQL Server 7. After recompiling it, and putting the database in SQL Server 2012. I want to access the current login user using the SQL function SUSER_SNAME().
This is the code.
Set rdoRes = goDatabase.Connection.OpenResultset("select suser_sname()")
But I'm unable to get the current user login in the application. If I write any other SQL statement instead of this, then it runs. But only this statement is not running. Is there any security reasons for this?
View 8 Replies
View Related
Sep 28, 2015
I've been quite excited about SQL Server MDS that should allow non-IT staff to easily maintain data. However maintaining data that have many-to-many relationships seems to be quite a pain. I believe the best way is:
Open up your MDS web interfaceGo to entities > product (for example)Add a new member and fill the details Click "product parts" in the bottom right "Related Entities" partAdd a new memberTry and find the product you just created from the dropdownlistSelect the first part and click OKAgain try and find the product you have created from the dropdownlistSelect the second part and click OKRepeat...Close the tab on your browser and finish your product entity.How I wish it worked:
Open up your MDS web interfaceGo to entities > product (for example)Add a new member and fill the detailsCheck a checkbox for each part visible under "product parts" in the bottom right "Related Entities" partFinish your product entity.
View 3 Replies
View Related
Apr 16, 2008
Hi when i try and open a database in sql server management studio i get the error "Cannot open user default database. Login failed. Login failed for user 'DOMAINUser'. (.Net SqlClient Data Provider)", what can i do to rectify this, i have googled around and still havent found no answers.
View 4 Replies
View Related
Mar 26, 2004
I have a table that keeps a log of al user inquiries. The business wants to a report that shows the last ten inquiries each user has made:
A sample result would look like:
User, Date, InquiryID
George, 10/1/2003, 1000
George, 10/2/2003, 1001
George, 10/3/2003, 1002
George, 10/4/2003, 1003
George, 10/5/2003, 1004
George, 10/6/2003, 1005
George, 10/7/2003, 1006
George, 10/8/2003, 1007
George, 10/9/2003, 1008
George, 10/10/2003, 1009
Harold, 11/1/2003, 1010
Harold, 11/2/2003, 1011
Harold, 11/3/2003, 1012
Harold, 11/4/2003, 1013
Harold, 11/5/2003, 1014
Harold, 11/6/2003, 1015
Harold, 11/7/2003, 1016
Harold, 11/8/2003, 1017
Harold, 11/9/2003, 1018
Harold, 11/10/2003, 1019
DDL:
CREATE TABLE UserInquiries (
InqiuryID INT IDENTITY(1,1),
UserName Varchar(10),
InquiryDate datetime)
INSERT INTO UserInquiries (UserName, InquiryDate)
SELECT 'George', '10/1/2003'
UNION SELECT 'George', '10/2/2003'
UNION SELECT 'George', '10/3/2003'
UNION SELECT 'George', '10/4/2003'
UNION SELECT 'George', '10/5/2003'
UNION SELECT 'George', '10/6/2003'
UNION SELECT 'George', '10/7/2003'
UNION SELECT 'George', '10/8/2003'
UNION SELECT 'George', '10/9/2003'
UNION SELECT 'George', '10/10/2003'
UNION SELECT 'George', '10/11/2003'
UNION SELECT 'George', '10/12/2003'
UNION SELECT 'Harold', '11/1/2003'
UNION SELECT 'Harold', '11/2/2003'
UNION SELECT 'Harold', '11/3/2003'
UNION SELECT 'Harold', '11/4/2003'
UNION SELECT 'Harold', '11/5/2003'
UNION SELECT 'Harold', '11/6/2003'
UNION SELECT 'Harold', '11/7/2003'
UNION SELECT 'Harold', '11/8/2003'
UNION SELECT 'Harold', '11/9/2003'
UNION SELECT 'Harold', '11/10/2003'
UNION SELECT 'Harold', '11/11/2003'
UNION SELECT 'Harold', '11/12/2003'
I'm brain dead on other things right now. Any help would be gratefully accepted.
Regards,
hmscott
View 1 Replies
View Related
May 22, 2008
Hi,
Please give the T-SQL script for this ? Thanks
Shanth
View 4 Replies
View Related
Nov 24, 2004
Hi,
I am new to ASP.NET so pordon me if my questions seems to be stupid.
I was given an assign to develop a ASP that would return results from a SQL server.
The problem is that part of my query to the SQL server comes from the webform
select a.invnum, a.invdate, a.duedate, a.invamt,a.payamt from vpshead a inner join vendors
b on (a.vendnum = b.vendnum) where (a.vendnum = " & user.text & " ) and (b.vendpass = "
& Pass.text & " ) and (a.payflag <> 'V') and ( (a.invamt <> 0) or (a.payamt <> 0) )and (a.chkno = '') order by a.invdate"
As your can tell I am using the user.text and Pass.text in my query which will come from the web form.
I know this is wrong but how else can I do it?
Thanks
View 3 Replies
View Related
Jan 7, 2007
Hey!
I'm trying to produce a user activity table out of a table that contains rows on when users log in or out. However, I can't seem to get the query to 'pick' the right date time in the join.
So, I have a table like this:
ChangeIDUserIDLoggedInDateTime
7107/30/06 12:30PM
6117/30/0612:20PM
5107/29/06 11:00AM
4117/29/06 10:30AM
3205/03/06 6:30PM
2215/03/065:30PM
1205/01/06 9:30AM
0215/01/06 9:15AM
And I want to make it into this table:
UserIDLoggedInDateLoggedOutDateDuration
17/29/06 10:30AM7/29/06 11:00AM30
17/30/06 12:20PM7/30/06 12:30PM10
25/01/06 9:15AM5/01/06 9:30AM15
25/03/065:30PM5/03/06 6:30PM60
Here is what I came up with, but it doesn't seem to be working right :eek:
select
distinct (userin.changeid),
userin.userid,
userin.createdate as LoggedInDate,
userout.createdate as LoggedOutDate,
DateDiff(mm,userin.createdate,userout.createdate) as Duration
from userChange userin
inner join (
select * from userChange
where loggedin = 0
) userout on userin.userid = userout.userid
where and userin.loggedin = 1 and userin.createdate < userout.createdate
order by userin.createdate desc
View 1 Replies
View Related
Jan 24, 2007
HI everybody...
Can anyone help me to know the
Query to Create SQL database Users in MS SQL
through the query engine of MS SQL Server Management Studio..
I am struggling with the same and I tried the one
create user <user_name> for login <login_name>.
But it seems that it will create the windows user itself and not the sql user.
I want a query similar to create user <user_name> identified by <password> which is used in ORACLE.
Please help me in this situation.
Thanks in advance
dance
View 1 Replies
View Related
Nov 30, 2006
I m new to SQL Server. Before this I was using access. In access one can have user inputs easily .. for example
where receivedate=[enter date]
how I can get userinputs in SQL server Query....
Forgive me if it is a dumb question
View 6 Replies
View Related
May 13, 2007
just getting started with my first db driven web project...
I am using a MySql database with membership and roles and got that working fine. I have tables containing details of courses that users are enrolled on etc. and want to display a list of courses for the user that is signed in, so he can continue lessons on the one of his choice.
How do I pass the users name to the database query for a DataList control. So far I have tried lots of variations of the following:
<asp:SqlDataSource ID="dsCourses" runat="server" ConnectionString="<%$ ConnectionStrings:xxx %>" ProviderName="<%$ ConnectionStrings:xxx.ProviderName %>" SelectCommand="SELECT c.CourseName FROM courses c, enrolments e WHERE c.CourseID=e.CourseID AND e.Username='<% =User.Identity.Name %>'"></asp:SqlDataSource>
<asp:DataList ID="DataList1" runat="server" DataSourceID="dsCourses"> <ItemTemplate> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Lesson.aspx">'<%# Eval("CourseName") %>'</asp:HyperLink><br /> </ItemTemplate></asp:DataList> </p>
However, the <% =User.Identity.Name %> doesn't work here (but it does elsewhere on the page) - not sure why?? The code works fine if I hard code a user name into the select statement.
Suggestions pleeeeeese!!
View 1 Replies
View Related
Jan 2, 2004
Is there a way to create a query that will return all user tables inside a sql db
Thanx
View 4 Replies
View Related
Sep 17, 2005
I need to be able to have users run a query under the 'sa' account that will create another account that will just be used for reading and writing to a specific database. Is there a way to do this with just a sql script or can you only set up logins and accounts from the enterprise manager?
View 1 Replies
View Related
Jun 23, 2000
I have a need to identify the name of a user and would like to access the NT userlist. Or failing a realtime access, can I achieve a periodic update of a SQL table with userid, username from the NT userlist?
TIA
Bob Morrow - Tennessee General Assembly
View 2 Replies
View Related
Feb 20, 2000
I am trying to retrieve the user names of all users within a database. The problem is, that I have only created a login within SQL 7.0 for the NT group that the users belong to.
As such, when I try to query the syslogins table I only get the NT group.
Is there any way of retrieving the users that belong to this NT group.
Any help or suggestions on this would be greatly appreciated.
Thanks,
Karl
View 1 Replies
View Related
Aug 23, 2001
Hi Everybody,
For a particular user, how to find what are all the tables he has been given the grant permission,etc., thru' query analyzer.
Can you please tell me, is there any command or system stored procedure is available to find this problem.
regards,
John
View 1 Replies
View Related
Jul 15, 2004
Hi folks, i am lookin for an option in the QA to take user input while executing a query. just like we do in SQLPLUS:
SELECT * FROM dept WHERE deptno=$abc
here it would ask me for the deptno. I guess it's a very handy feature and we could test our variables and calculations withing the procedures etc.
Is there a way, or any substitute?
Howdy!
View 14 Replies
View Related
Sep 21, 2006
Anyone have a tsql query that will give me a listing of database roles and their users already put together?
View 1 Replies
View Related
Jul 16, 2013
There is a large data table called emp_history on an SQL Server, which contains the employment history of each employee. The significant columns are as follows:
entry_id employee_id start_date position
where entry_id is the primary key and auto-increments.What I need, is to create a query to extract the employee_id and position, based on the most recent record (most recent start_date) for each employee.
View 6 Replies
View Related