2,935 Topics
| |
Hi All I am writting an stored procedure to get the recently inserted records primary key as follows: [CODE]ALTER PROCEDURE [DBO].[AddEditUserMsgDetails] ( @iJobID [INT]=NULL, @iUserID [INT]=NULL, @vFromName [VARCHAR](50)=NULL, @vFromAddress [VARCHAR](50)=NULL, @vSubject [VARCHAR](50)=NULL, @iListID [INT]=NULL, @vActualText [VARCHAR](100)=NULL ) AS BEGIN /* Logic Comments: INSERTING OR UPDATING INTO THE TABLE ezlMailJobs EXEC … | |
When some datas are inserted in to a DB table from a jsp page, how do i get the primary key in my table autogenerated?? finiding out the highest value for the primary key in the table? Pls help me wid the coding in JAVA or HTML.. I use SQL*PLus. | |
I have an awkward problem. I'm debugging what I believe is a race condition in a legacy codebase. The issue involves a userID column being set to the wrong value. Essentially, one user's record will be non-deterministically reassigned to another user. The real problem is that this column is set … | |
hi. i would like to work on my computer without connecting to server. i installed the ms sql management studio 2005 express. how can i create a local host server to work on ? | |
Hi everyone. I'm printing a list of articles from my database. Some articles are set as 'sponsored', meaning they appear at the top of the list. Articles also have a 'type' field - if it's set to 0 then there is no specific type, otherwise the value corresponds to a … | |
Hi I wrote simple query like [code=sql]select Code,CashDeposited,Date from dbo.RDBankingDetails where Code='SE0001' group by Date,Code,CashDeposited[/code] It generate report like below TE0001 12000 2005:03:26 TE0001 49150 2005:03.26 TE0001 209000 2005:03.26 I want to generate the report like below Code Date CashDeposisted1 CashDepostis2 CashDeposists3 TE0001 2005:03:26 120000 49150 209000 In above CashDeoposisted … | |
Hi Everyone, I would need your help. I have a project that I need to insert multiple records into my table. Here is more detail. I design a purchase order table with 3 columns (a, b, c): a: is primary key with identity (1,1) primary key b: is defined integer … | |
Hello Everyone! I'm new to MS SQL, so this may be a dumb error, but anyway, I can't figure it out. I'd like to connect to an SQL server on the internet, I've a valid username and password, but it can't find the server. So, I've tried the following connectionstring: … | |
Hi, [code=sql] SELECT DISTINCT dbo.RoomRates.RoomID, CASE WHEN (dbo.RoomRates.Overflow = 1 AND MIN(dbo.RoomRates.Availability) <= 5) THEN 5 ELSE MIN(dbo.RoomRates.Availability) END AS Availability, SUM( dbo.RoomRates.Price ) AS RoomTotalPrice FROM dbo.RoomRates WHERE dbo.RoomRates.[Date] BETWEEN @FromDate AND @ToDate GROUP BY dbo.RoomRates.RoomID , dbo.RoomRates.Overflow[/code] Input [code] roomid Date AvailableRooms RoomPrice FreeSale 100 01/12/08 FA 0 … | |
Hi I hope I have the right forum for this. This is a tricky one....I think! I have a reporting services report that runs off a csv file using integration services 2005. The report is based on a link between two tables linked by cc. The cc field links to … | |
hi, i m fetching the record from the given xml but not success full please help [code]DECLARE @XMLString xml set @XMLString ='<timetable> <day1 id="DY101"> <lecture1 id="LECT101"> <subject>SUB101</subject> <faculty>FAC101</faculty> <room>ROOM101</room> </lecture1> <lecture2 id="LECT102"> <subject>SUB102</subject> <faculty>FAC102</faculty> <room>ROOM102</room> </lecture2> <lecture3 id="LECT103"> <subject>SUB103</subject> <faculty>FAC103</faculty> <room>ROOM103</room> </lecture3> <lecture4 id="LECT104"> <subject>SUB104</subject> <faculty>FAC104</faculty> <room>ROOM104</room> </lecture4> <lecture5 id="LECT105"> … | |
I've got a multi union sql statement however union distinct doesn't work the way I want it to because I just use distinct on 1 column only (link_id). I've several ideas from the internet but I just can't get it to work. Below is the statement. [code] SELECT TOP (500) … | |
I'm not sure I did this right. It's for an assignment for school where i'm supposed to return the author last name and the balance (described below) relating to each author. It's from the pubs database (I'm thinking that most people have used it for testing/learning before?) I'm an SQL … | |
New to triggers and SQL programming but I'm trying to figure it out by looking at code examples. I have a table, called child. My program inserts a new child into the child table and stores the parentid as a FK. What I need to do is when a new … | |
How do I get [B]ONLY[/B] data type and name of all the columns available in given table_name | |
Hi, I'm having trouble building the correct syntax select statement for a system to handle support tickets. The table "tickets" has the following columns: id (int) inserted (smalldatetime) ticket_id (nvarchar) owner (nvarchar) subject( nvarchar) category (nvarchar) message( nvarchar) status (nvarchar) The id is unique for each record but the ticket_id … | |
| [I]In this example I'm using the AdventureWorks database in MS SQL Server 2005[/I] I was wondering what other people thought about Schemas vs. Roles when it comes to security access. If you have an employee who just started working for Human Resources and needed access to all the database objects … |
Hi, I have a derived attribute in my table and I'm sorting the table in the descending order of this attribute. My query should retrieve all the tuples which have the maximum value for this derived attribute. If I use SELECT TOP 1, I'm only getting one of the required … | |
Heya, what i would like to do in one query is pull out two objs, that are very similar from the same table "ol_obj_data" These two objs are "ratings" and "reviews" they are not linked except for a USER_ID of who submitted them. But they relate to our business data. … | |
The two queries are returning two different no of rows.Outer join is not supposed to duplicate the rows in the first table right?How do I correct this. [code=sql]select * from clientcode order by cc_clientcode result:(5627 row(s) affected) select cc.cc_clientcode,cc.cc_rmcode,cc.cc_panno,cc.cc_productname ,c.Client_panno,c.client_userid from clientcode cc LEFT outer join client c on cc.cc_panno=c.client_panno … | |
Hi everybody, I have really damned trouble here... On MSSQL 2000 I have something about 140 log tables with three columns in each one. "ID" AS INT, "SomeTextCODE" AS NVARCHAR(20) and "SomeTime" AS DATETIME I made a view (v_SomeView_ALL) in which there are all these tables united. But some SomeTextCODEs … | |
Can anybody explains me why following sql statements do not work with mssql? create table place (id int primary key, name varchar(64), parent_id int references place (id) on delete cascade); create table transport (id int primary key, name varchar(64)); create table trip (id int primary key, from_id int references transport … | |
im in the process of looking at a reporting tool for my database system - can anyone point me in the right direction for the best product available. i previously used crystal a very long time ago (it may be called something else by now) but ive read alot about … | |
Hi I'm to stupid to write sql but im trying my hand at it anyways. I cant work this out any easier than doing a seperate command but when i do that it takes forever. So i tried doing it as a subquery, but i think somehow i need to … | |
Hai, ive created a SQL database, but now i want to place and use this on another PC. Is it possible to write the database files to a CD or DVD and then copy it to another PC? If yes then please explain how. Thank you | |
Hi ALL, The project we're working on is a document retrieval system. Two kinds of Features for each document in a repository are extracted as described in table-1 and table-2. Table1 DocID Word Freq 1 Book 9 1 Study 3 2 Work 4 2 Run 5 2 User 2 3 … | |
Hello, I would appreciate if anyone could help me with this. I'm new to this sort of thing and don't really know where to start. I have a survey results table that looks like this: [CODE]user question answer Mike 1 2 Mike 2 1 Mike 3 5 John 1 5 … | |
Hello, I've just migrated a website built with asp and MsSQL to a new server. The old server used MsSQL 2000 nd the new one uses MsSQL 2005. I know the database became slightly corrupted when it was uploaded. I was just wondering if anyone could tell whether the varchar … | |
Hi, I am trying to break each record into 2 records but failed Is it possible? What is the correct way to do it? Thanks in advance!!! For Example: I have a table that contains 100 records . Each record has the following 10 columns: Col1, Col2, Col3, Col4, Col5, … | |
The End.