I have a simple sql that selects records from some tables and insert them in one other table.This is what we need to do on a daily basis and we need to create a sql job for this.
moving some tables & stored procedures from SQL Server 2000, to SQL Server 2005.So far so good, but I've come across a problem with this stored procedure:
I want to generate 30,000 cards and each card must be duplicate check with database. In my card, there are 2 things. Serial No and CardID. If any card already exists then I generate another card id but with the same serial no.
So how faster way I can generate 30,000 card with duplicate check? Which one I have made application, it takes about 25 minutes to insert.
i have a string like "13-9-10" i want to insert this as date into sql server 2005 in to a coumn "custdate" as type as datetime i added a sql paramater like this
Private Sub demoinsert(ByVal arr_data() As String) DbCmd.CommandText = "INSERT INTO TBL_enqloan(cusdate) VALUES(@cusdate,)" With DbCmd.Parameters .Add("", SqlDbType.Date).Value=Convert.ToDateTime("arr(0).tostring") end sub
I have such sql query, in which there are 8 to 9 temp table generated and from each temp table, I am fetching data with use of read table.
I want to store temp table output into gridview, but after using sqlcommand,I am able to display first temp table output into gridview, but after executing query first temp table destroyed and second sql query which is using first temp table, is not getting reference. as first temp table is not available.
e.g. #temp1 -> I am able to display out put in grid view & destroyed
#temp2 -> which is using #temp1, but not getting reference of #temp1.
I used SQL SERVER 2008 R2 express as my web development database and I set its compatibility level to 2005. Unfortunately this database cannot be be attached to SQL server 2005. Are there any other options?
i am unable to handle jquery accordian. I want to bind it to ta database. I wanted that the user shuld be able to enter the values in a text box through an admin panel which i shoud make for him and those values should be displayed in the accordion panel through the database but........... I am unable to connect and show daabse values in accordian.. don't know whether my connection is not ok or my technique is wrong can anyone help me in this regard??
Here is the code for making the connection..
protected void Page_Load(object sender, EventArgs e)// Create a connection to the "DatabaseAccordian" SQL database located on the // local computer. { SqlConnection myConnection = new SqlConnection("server=localhost;" +"database=DatabaseAccordian;Trusted_Connection=Yes");// Connect to the SQL database using a SQL SELECT query to get all // the data from the "AccordianEvent" table. SqlDataAdapter myCommand = new SqlDataAdapter("SELECT * " +" from AccordianEvent", myConnection);// Create and fill a DataSet. myCommand.Fill(ds); {DataSet ds = new DataSet();if (ds != null)// Bind MyDataList to the DataSet. MyDataList is the ID for // the DataList control in the HTML section of the page. MyDataList.DataSource = ds; MyDataList.DataBind(); } else Response.Write("<p>No customer selected</p>");}
this code is compiled code with no syntax error.
if there is any other thing needed to be done for making the connecion.
<div id="accordion"> <h3 style="color: Black"> <a href="#">News & Announcements</a></h3> <div> <p> 23rd March will be a holiday </p> </div> <h3 style="color: ThreeDDarkShadow;"> <a href="#">Events</a></h3> <div id="divEvents"> </div> </div>
i am trying to compare four columns in two tables(both are in the same schema), table a has two columns for firstname and last name , table b has similar columns firstname and last name, i wish to compare both and if there are similarities, do nothing but if there are differencies, export or write them to a exception or error table.. not quite sure what if statement i should write or how to go about this.
I am trying to transfer some tables and stored procedures from SQL Server 2005 to Express 2008. I have tried using Management studio, but it isn't working....
I want to insert some data into SQL Table.i'm using a form which contains one dropdownlistbox,four text boxes and one submit button.if i select a option in dropdownbox and entering somedata into the corresponding Textboxes and then clicking the submitbutton.it should inserted in to the correct table which one i have selected in the Dropdownbox option.
I'm using stored procedures and DataContext to insert data to SQL Server database (ASP.NET 4 + SQL Server 2005 database, GoDaddy hosting)But after inserting russian text I see smth like this - '??????'If I insert constant text I'm using following construction - N'russian_text' and it works fine.Of course, I need to use variables as procedure parameters BUT I can't use it (for example - N@var fails)ALTHOUGH I'm using N-type fields in tables (nvarchar etc.)
I am designing a social networking site that has a "wall" feature like the others out there today. The database has an alerts table that stores some user action worthy of sharing with his friends. For example, when a user updates his status, all of his friends are notified. The below table shows two status updates from two unique users. The first (AlertId 689 and 690) is submitted by AccountId 53. Since he has one frinend - AccountId 57 - that row is added to the table so when this user logs on, he will see Account 53's update on his wall. In the same manner, the other user's status update has four rows because he has three friends.
[AlertId] [AccountId] [CreateDate] [Timestamp] [AlertTypeId] [IsHidden] [Body] 689 57 2010-08-10 0x0000000000018725 10 0 HTML 690 53 2010-08-10 0x0000000000018726 10 0 HTML 691 53 2010-08-10 0x000000000001872B 10 0 HTML 692 52 2010-08-10 0x000000000001872C 10 0 HTML 693 51 2010-08-10 0x000000000001872D 10 0 HTML 694 57 2010-08-10 0x000000000001872E 10 0 HTML
Now, a user can comment on any given item, in this case a statusupdate. When AddComment is submitted, we are using ObjectRecordId (which is the primary key of the alert being commented on) in order to identify which statusupdate is being commented on (fyi - the objectId tells us its a statusupdate):
public void AddComment(string comment) { if (_webContext != null) { var c = new Comment { Body = comment, CommentByAccountId = _webContext.CurrentUser.AccountId, CommentByUserName = _webContext.CurrentUser.UserName, CreateDate = DateTime.Now, SystemObjectId = _view.ObjectId, SystemObjectRecordId = _view.ObjectRecordId }; _commentRepository.SaveComment(c); } _view.ClearComments(); LoadComments(); }
Now, the problem is that when a user wants to comment on a friend's status update, he will be using the AlertId (or ObjectRecordId in the Comments table) corresponding to his account in the alerts table. The result is that comments are only viewable by the commenter and none of his friends:
Of course the solution to this is to do something similar to what I did in the alerts table - when somebody makes a comment, make a corresponding row for every friend in the comments table. But how do I access the AlertIds of all of my friend's status updates in the Alerts table and map them to the ObjectRecordId column in the comments table? Since I can only access the status updates corresponding to my account (and their corresponding alertids), I don't know what the alertids are for the same statusupdate in my friend's accounts.