I trying to get the moving total (juts as moving average). It always sum up the current record plus previous two records as well and grouped by EmpId.For example, attaching a image of excel calculation.
I want to create the most effective way (google) to have content displayed on a web page. Currently, we are updating to SQL and populating to web via calling SQL statements hardcoded to page. I want to know if this is ok to do, or should we be reading from a static XML file that is updated? I think the XML is the way to go being that i may have answered my own question, but i was curious to what the experts on asp.net had to say. Thanks,Nick
I'm just using TEXTBOX control to save data into my DB. My question is, if I have multiple lines of sentences, it does not store as what it looks like. For example;
Hello, Mike
It stores into the database as "Hello, Mike" and if I read from the database, it does not have seperate lines and shows it like this; Hello, Mike
How can I store the contents into database and make the contents as original? (Sorry for the poor English, but I hope you understand it.)
Hi All,I have a job coming up which involves me creating a vacancy system for our website.I (think) I'll only need one table:ID (PK)JobTitleJobLocationSalaryHoursJobDescriptionValidFrom (Date/Time)ValidTo (Date/Time)I'll display this data using a C#.Net repeater but I was wondering how I can automatically strip the page of the jobs that have gone past their expiry date? Is is straightforward to achieve?Thanks in advance,Brett
HiI have developed a sql procedure for updating some xml content using SQL 2005 xQuery features.For example:Declare @xmlContent = '<books><book name="asp"/>< book name = "sql"/></books>'--Now I want to add attribute "book_id" to the xml content.SET @xmlContent.modify('insert attribute book_id{"1" } into (/books/book[@name="asp"])[1] ')SET @xmlContent.modify('insert attribute book_id{"2" } into (/books/book[@name="sql"])[1] ')SELECT @xmlContent--OUTPUT will be<books><book name="asp" book_id="1"/><book name="sql" book_id="2"/></books>QUESTIONQ1. Do we have any extension or plugin such that this SQl 2005 xquery feature can be incorporated in SQL 2000?Q2. If the answer for Q1. is no (as I expect), then do we have any TSQL feature in SQL 2000 for modifying xml content?I found all examples in SQl 2000 related with "openxml" function which performs the select kind of operations only. Like selecting data in XML format OR converting xml data in to tabular format. But I couldn't find any xml modification TSQL in SQl 2000 which can add element/attributes or change values.one workaround could be to consider xml content as string and use string functions to modify the content.But is there any more sensible approach available in SQL 2000?
Okay, moving to developing a small site that will be storing articles - that is a site largely consisting of html marked up articles with images. We already have an SQL Server so it is becoming the back-end.
So, since I'm not an SQL Server expert, some general advice on this would be appreciated? The articles, as I say in HTML (largely just markup for titles, and general text) would be stored in the DB? As Text datatypes?
The problem is, I have a table with one column of varchar(8000) datatype. It has got 1000's of records. Through Query Analyzer, I am not able to view my records after 257 columns in my table, even I increased my textsize by using 'set textsize' command.
Any other setting is available to correct this. Any help is appreciated.
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?
I'm the project lead for SQL Server Express in Microsoft (as well as owning the Storage Engine). I'm going to make sure that threads on this forum get answered - I see a bunch with no answer so far.
Now to the point - we’re in the process of assessing the content that exists to help people learn and use SQL Server Express. This includes demos, tutorials, whitepapers, Webcasts, Starter Kits, and any other type of content you could imagine. So this is a great chance to TELL US WHAT YOU WANT! We’ll integrate your feedback and make sure that we try and address the most requested areas of content. Please be as specific as you can.
Thanks in advance for your feedback.
Paul Randal Lead Program Manager, Microsoft SQL Server Storage Engine (Legalese: This posting is provided "AS IS" with no warranties, and confers no rights.)
I have a field 'LastName' in a SQL 2000 table 'customers' that is populated with all our customer's full names in this order:
Smith John M
I need to flip the information around so that it can be exported into a CSV file for an automated email notification program to notify them their items are in and having it in first, last, MI format is much more professional.
I've been playing with charindex and stuff routines and am spinning my wheels. Is there a canned routine for something like this - this must have been done a hundreed times out there in SQL somewhere (or it's so easy to do that everyone (but me) just cranks it from scratch).
hi,i have a sqlserver CE and a sqlserver database.The tables are exactly the same on both databases.the sqlserver CE database Content will be synchronized with thesqlserver database with insert orders..is there a way to merge the two databases?this would be great cause different content will be inserted in bothdatabases. After a synchronisation both databases should have the samecontent..i hope you understood my problem. my english is not very well..christian
HiI have set up a SQL database to contain alist FAQ's for our company andthen plan to pull this info off using a web page.So far I have entered the data but I am unable to control how it isdisplayed inside SQL ie I cannot enter new blank lines I have triedusing lots of spaces but this does not work when I use the website todisplay the info.Is there a way of formatting and editing the data in the sql databaseas I am unable to do this, if I try to edit the data in the database Ihave to copy it to notepad delete what is in the database, edit thetext in notepad then paste it back in.There must be a better way.Please helpalamb200
HiI've developed a simple web service that lets people easily set up their ownwebsites, and keep them up-to-date themselves.I'm storing all the content, including images in the SQL 2000 database. Sofar it's working well enough. Is there likely to be a performance orreliability problem as the system grows?You can see it in operation here: www.up-to-the-minute.comIt's early days and any comments and ideas are welcome.John SouthPangbourne UK
Hello,On our corporate website, we will be using email notifications forvarious things. I would like for our marketing guy to be able to editthe email templates over the web so that I don't have to keep updatingthem myself for every little change. I want to store the templateswithin the database (since they will be small). The templates will beHTML based and not more than a few thousand bytes in length. Should Iuse a VARCHAR or VARBINARY, or what? I would assume VARCHAR, but I'mnot sure.Thanks,Will
Our Business partners request me to read the field names from a SQL table dynamically so that my SSIS package will not get impacted if Web Service hosts make a change.
Is there a way to evaluate a string at runtime that contains a field name ?
HI, We are using SQLLDR to send data from SQL Server to Oracle database. This utility creates a log file. I want to know whether there is a provision to change the contents of the file. We use this utility in multiple SQL Servers to send the data to the same Oracle Server. Can we add the source server name in the file so that identifying which server does a particular log file belong to? How?
several days ago I've seen a sample code from Books Online which retrieves the content of error log as a rowset using a single SELECT statement. But now I can't find that article. Instead of this I've found the stored proc sp_readerrorlog which is undocumented. So I'd prefer the using of documented approach. Has anyone seen that article? Please remind me its location if so.
I have built a report using a Cube (and not a relational database).
I have a date as a parameter and I would like to filter its content: the parameter goes from 1900 to 2090 and I would like the user to see only from 2006 to 2090.
Can you help me by giving me tricks to do it ? There may have several ways of doing it but I can't find them.
I am trying to copy the tables, relationships, and data of a logical database...
From: a logical database in SQL Server 2005, where I have instance-wide system admin privileges (supreme power)
To: a pre-existing logical database in a different SQL Server 2005 instance, where I merely have "database owner" privileges to that logical database (I have no "instance-wide" privileges).
This is a one-time effort (as opposed to nightly). I have found a way to reproduce the tables and relationships ("generate scripts", then run the script on the new server). I have also found a way to export/import the data. But I have not found a way to effectively do both. In other words, if I create the tables and relationships, and then attempt to import the data, I get tons of relationship violations, because the data is not being imported in a "dependency-sensitive" order or fashion.
So can somebody tell me how to do this, or tell me what I'm doing wrong? Remember, I do not have "Create Database" rights on the destination server - so I can't use the "Copy Database" command (darn). Any help?
Is there any way to limit the content that is placed into the Progress Tab during execution of a package in debug mode?
My problem is that I have a complex package that puts lots of info in there. This package is called in a loop from another package. Each time the package is called, the new info is added to the existing info in the Progress Tab. Eventually the instance of Dev Studio hangs when it gets too much content in that screen.
The only solution would be if I can limit the output content of that screen or turn it off.
hi there, i have a payment page which uses javascript to calculate payments and what remains etc. That all works fine, the problem i have is that when you are finished and you go to the next page it should save all of the records to the order table where the order_id = a querystring. Now i have tried using an insert method and an update method, not really sure whats the difference when putting data into an existing record. What happens though is that i can save the contents of labels etc but it wont save the content of dropdown lists (of which there are 2) i just cant work it out, i have posted my code below string strOrderID = Convert.ToString(Request.QueryString["OrderID"]); string strDiscountPercent = Convert.ToString(5656);double dblDiscountMoney = Convert.ToDouble(txtDiscountMoney.Text); string strPaymentMethod1 = ddlPaymentMethod1.SelectedValue;double dblPaymentAmount1 = Convert.ToDouble(txtPaymentAmount1.Text); string strPaymentRecipt1 = txtPaymentRecipt1.Text;string strPaymentMethod2 = ddlPaymentMethod2.SelectedValue; double dblPaymentAmount2 = Convert.ToDouble(txtPaymentAmount2.Text);string strPaymentRecipt2 = txtPaymentRecipt2.Text; string sConnectionStringCustInfo = "my connection string"; SqlConnection objConnOID = new SqlConnection(sConnectionStringCustInfo); //This is the sql statement.using (objConnOID) { objConnOID.Open(); string sqlUpDate = "UPDATE tbl_order SET discount_Percent = " + txtDiscountPercent.Text + ", discount_money = " + dblDiscountMoney + ", payment_method1 = " + strPaymentMethod1 + =========== this is the problem line here! ", payment_amount1 = " + dblPaymentAmount1 + ", payment_ref1 = " + strPaymentRecipt1 + ", payment_amount2 = " + dblPaymentAmount2 +", payment_ref2 = " + strPaymentRecipt2 +
"WHERE order_ID = " + strOrderID;
SqlCommand objCmd1 = new SqlCommand(sqlUpDate, objConnOID);
try {
objCmd1.ExecuteNonQuery(); }
and because it throws an error it wont update the database with any other record. does anyone have any ideas, i have spent hours last night trying to figure this one out and im sure its simple! but i need some help!
Hi all, i've problem with creating a select to order by a column where i will use a specific part of the cell content. The rows ar looks a follows ID | Titel | Ausgabe | Seite | kurzInfo........ 5 | 3 Must-have-tools | 01/2006 | 32 | Oft sind es die...... 6 | RowID in DataControl | 06/2005 | 11 | Gott sei Dank muss ..... now im looking for a solution to sort by the column [Ausgabe] but by the part after the slash so it looks like ........ | Ausgabe | Seite | ................| 06/2005 | 11 | ................| 01/2006 | 32 | ....... Is this possible without a sub select?