Hi sanndeb
There are a few possible ways of doing this. Here is what I would do:
1. Get the unique Group IDs into a temporary table
2. Use this temporary table with the original table to generate the XML.
Here is the code I wrote to create the XML:
-- Create a temp table with the Group Ids
SELECT DISTINCT GroupId
INTO #tmpGroups
FROM #EmployeeTable
-- Generate the...
User Profile
Collapse
-
Hi santhanalakshmi
Hmm, not much to go on here. I would suggest that you make sure that your version of XP will support SQL Server 2008.
If you have something like Windows XP Professional SP2 x64, you should be fine. If you have an Itanium processor, you should double-check it is supported.
Kind regards
Brad Orders...Leave a comment:
-
Hi Ginny28
Here is some example code for tackling your problem.
This is what I use as a starting point whenever I am working on the type of problem you are describing.
Hope it helps!
Kind regards
Brad
declare @TestData Table
(
RecordId INT IDENTITY(1,1),
STUDENT_ID VARCHAR(6),
TF Decimal(2,1)
)
...Leave a comment:
-
This is a tricky one. If access to a table is locked up and requires a restart of the SQL Service, then this isn't a run-of-the-mill issue.
I would suggest backing up the database, then reviewing all triggers in the database, especially any added recently.
Is there a job that is scheduled to run at that time? If so, review the code in the job.
Just to cover all bases, check some varchar/nvarchar column values...Leave a comment:
-
Hi romiverma
Try replacing all single quotes with two single quotes.
(eg. ' becomes '').
Hope this helps.
Brad OrdersLeave a comment:
-
Dynamic SQL in an INSTEAD OF trigger causes recursion
Hi all
Here is my situation:
When table A is updated, I need to record some data in table B, then apply the update to table A
Normally I would use a FOR UPDATE trigger, but the table has a TEXT field in it. Therefore, I must use an INSTEAD OF trigger.
Columns may be added to this table without my knowledge or control, and without warning.
Here is the approach I took inside... -
I would suggest that the approach that you take will depend on what you want to do with the data. If you are wanting to only return one month at a time (for example, the user provides a month and you return all the records for the month), then you could query the table, order by Transactions DESC, and put this into a temporary table that has a auto increment. Then you could SELECT the temp table, and the increment would give you the number you...Leave a comment:
-
You could also consider putting the values inside the "IN" statement in their own table. Then you could solve the problem by doing a simple join, and order by the identity ID in the new table.
If performance is important, this is a solution worth considering.Leave a comment:
-
Assuming that you want a user to have many profiles, there is more than one way to do this.
One:
The user presses "Save", and their information is deleted from the database, and the new information saved. This is the option you have mentioned.
Two:
The user presses "Save". The code (eg .NET) checks for profiles that have been marked as "Delete", and deletes them. The code...Leave a comment:
-
Hi Sonia
If you are using SQL Server 2005, you do it by expanding Databases, {Database Name}, Programmability , Functions.
Hope this helps.Leave a comment:
-
Also, take care if you are using the URL:
http://server/webapp/Default.aspx?cu stomerid=xx
You will need to make sure that one customer cannot impersonate another customer by simply changing the customerid in the URL. This will need to happen on every page in the web app - not just the page after login.
I agree that the customer should provide a password as well as their id. If security of the database is also...Leave a comment:
-
The most efficient way would be to do this at the code level rather than the database level. Doing this kind of query at the database level will be slow and can be a bit messy.
If you are using .NET, you could the stringbuilder object, and loop through the results from the database.
HTH.Leave a comment:
-
Hi Thesti
I am assuming you want to work this out in SQL Server and not .NET...
Here is the approach I would take:
Assuming I had TableA and TableB. I want to find out all the records in TableA that aren't in TableB, based on a column RecordId. First step, find out all the records in TableA that ARE in TableB:
...Code:SELECT a.RecordId FROM TableA a INNER JOIN TableB b ON
Leave a comment:
-
Hi MasterBlaster
With the tables you have at the moment, the easiest solution is to use the C# approach suggested. However, I would suggest that, if possible, you look into changing your tables so that you have a "DateEntere d" column. Then you don't have to change the database schema every month, and the query becomes a simple "BETWEEN" statement.
HTHLeave a comment:
-
Hi SonySunny
It sounds like you have a scope issue. If you always call the second stored procedure after the first stored procedure, then you should call the second stored procedure from within the first stored procedure using the "EXEC" command. Then the second stored procedure will be able to "see" the temporary table.
However, if the first and second stored procedures do not always follow each...Leave a comment:
-
Hi Pawan
When you said "I have to insert the value of this dataset to a table", did you mean a database table? If so, are you (1) trying to update the databases with changes made by the user, or (2) are you transferring data from one table to another?
If (1), then only update the rows that have been changed. If (2), try transferring the data from within SQL Server, and try and avoid sending the data via ...Leave a comment:
-
I'm not sure, but is this the kind of thing you are after?
If you want to order the results by a column in descending order, just put DESC after the column name (eg. "C2 DESC")Code:SELECT C1 FROM TableName WHERE C1 = @SomeParameter ORDER BY C2, C3, C4
HTH.Leave a comment:
-
I would suggest sorting the DataSet or DataTable before setting it as the DataSource.
Personally, I try and do any sorting as close as possible to the data. So if it is from a database, I would generally sort in the Stored Procedure, and so I avoid having to deal with this problem.
HTH. If you are still having a problem, please post some code.
Good luckLeave a comment:
-
Hi Yogarajan
There are a number of ways you can do this, ranging from simple to painful. If you are just using a Datagrid, then one simple and quick way to display it in Excel is just change the content type like this:
However, you will need to make sure that the HTML in the page is clean and really simple. I would suggest making...Code:Response.ContentType = "application/vnd.ms-excel"
Leave a comment:
-
Yes, I agree with Jagged. You can use his script to simulate the answer you want, but you really, really should change your table structures if at all possible. Your efforts now will save you a lot of work in the future. Good luck.Leave a comment:
No activity results to display
Show More
Leave a comment: