2,736 Topics
| |
Hi I have this data [code] CustBid idProduct bidAmount bidDate 1 272 165.00 2009-11-20 09:05:31.640 1 272 155.00 2009-11-20 09:05:25.480 4 272 95.00 2009-11-19 12:40:44.973 4 272 85.00 2009-11-19 12:40:40.377 1 272 85.00 2009-11-12 11:20:52.400 1 272 85.00 2009-11-12 11:20:52.400 4 272 75.00 2009-11-12 11:11:02.080 1 272 65.00 2009-11-12 11:20:20.170 … | |
I use SQL Server 2005 and I create function.Below I mention the Function that I created. [CODE] CREATE FUNCTION dbo.udf_GetCountryID(@Name varchar(50)) RETURNS VARCHAR(1000) AS BEGIN Declare @Description varchar(4000) select @Description = coalesce(@Description + ',' , '' ) + countryCode FROM dbo.Test_Table where CommonName='Japan' Return @Description END[/CODE] After creating function I … | |
I am trying to write a query in my .net app and I'm having trouble pivoting the table since the columns are generated dynamically (based on a month range selected by the user) [CODE]SELECT SUM(HEALTH_MTTR) AS MTTR, SUM(HEALTH_OTR) AS OTR, SUM(HEALTH_REPEAT) AS REPEAT, SUM(HEALTH_CHRONIC) AS CHRONIC, SUM(HEALTH_TOTAL) AS TOTAL, (CAST(CAST(YEAR([DATE_RESOLVED_FOR_CLOSURE]) … | |
hai all i am facing some problem in SQL.I am searching the one string(ex.roll-over) in table its returning wrong results. my table contains, dable datas table_1 is table name number1 text1 1 notify us the day you roll check over. 2 notify us theday you roll check . 3 notify … | |
Hi I have a column named 'ExtRefNo' which of varchar datatype. The values can be numbers alone(eg; 101) & values comprising characters & numbers(eg:101A3) My requirement is if the user search for ExtRefNo between 100 & 105, it shud retrieve all ExtRefNos ranging from 100,101,102,103,104 & 105. Need not include … | |
DRIEND FRIENDS, I am given a project "hospital administration database" Could you please guide me how to start and proceed. Thanks and Regards. Shariq | |
Hi Guys It may be friday, but I am having a real brain fade with this one. I have one table which contains several columns (see below) I need to match names in the tables. The first name is in column childname1 which contains the full name, the column I … | |
Use this code [code] sql = "SELECT products.endDate FROM products INNER JOIN " sql = sql & " auctionevents ON products.idsupplier = auctionevents.idSupplier " sql = sql & " WHERE (products.endDate > CURRENT_TIMESTAMP) AND (auctionevents.ID = "&id&") AND (products.ListHidden <> 1)" [/code] but if the server is not run the … | |
Hi. I have a question to advanced SQL programmers/users. I would be very grateful if you could explain me in simple words why we use multiple joins on the same table (for example multiple left outer joins) - what benefits it brings? examples would be appreciated best regards q | |
Hi, I have created a temporary @table and while inserting ,i am using dynamic sql.But this is not getting executed and throws an error that "EXECUTE cannot be used as a source when inserting into a table variable" i am using SQLServer2005. Dont know where i am going wrong [code] … | |
I get the following message when executing a stored procedure. [COLOR="Red"]The query has exceeded the maximum number of result sets that can be displayed in the results grid. Only the first 100 result sets are displayed in the grid.[/COLOR] However , i cannot change the fact that the SP uses … | |
PRACTICA EXAMPLE FOR Scheduling Jobs in SQL Server 2005 | |
Hi,,, we have a database grown too fast... from 19GB last march 09 into 52GB this Nov 09... I search through internet on what happen why do database grow fast and i find nothing,, i found out on how to "sp_spaceused" query and the result says: database_name database_size unallocated space … | |
I'm currently studying SQL and have created two tables (Orders and Inventory). I have been trying to create a trigger on the "OrderDate" column of the Orders table to update the Cur_Stock value (to subtract the Quantity ordered from the Cur_Stock) on the Inventory table whenever a new Order is … | |
Hi all, i use mssql 2005 I have a doubt, how to create a schedule for a query to run every day,the result should be saved every time the query runs, into a new file For the moment I use SQL Server Agent to do this daily, with a jobtask … | |
Hi,, i am a newbie in SQL server.. we have a database in our office.. I notice that since 2004 - 2008 our database growth was about 19GB, but since jan. 2009 to present our database grows from 19GB to 52GB... is there's something wrong happening in our database's configuration? … | |
Good Day All i have the Following that table [CODE] ID | ACTV |VENU |STUD | TRIES ===================================== 1 1 4 162 0 2 4 5 104 0 3 8 5 138 0 4 15 2 68 0 5 15 4 291 0 6 21 4 171 0 7 22 … | |
hello everyone, i need a code snipet that can help me retrieve username and password and to authenticate the password in the database.. | |
Hi, I am trying to transfer some data from a Mysql database onto a Microsoft SQL database. I would need your help on how to operate this migration as I am new to MSSQL. I have been looking on Google but there are not a lot of pages on that. … | |
If i have some xml in the form [code=xml]<root> <a>hello</a> <b> <bi>hiya</bi> <bii>hey</bii> </b> <c/> <d>hello again</d> </root>[/code] how can I a) count the nodes? i.e. a, b, bi, bii, c, d so 6 b) count the nodes that are non empty a, bi, bii, d so 4 ? i … | |
I have a query that works, I wanted to add another sum from another table, but when I do, the all the SUM values are wrong this works [CODE]SELECT Clients.ClientID, Clients.WholeName, SUM(CASE WHEN Payments.Creditorid = 0 THEN Payments.Amount ELSE 0.00 END) AS 'Admin Fees', SUM(CASE WHEN (Payments.Creditorid = 3) THEN … | |
Hi all, I have a single table with both parent and child nodes, and each has an order number in it. I am trying to write a single query to output them in order, its for a navigation list with categories and sub-categories. I could manage it in code rather … | |
Hi, I have an insert statement that i need to refine...basically I need to trim the first couple of letters of whats trapped inthe field. so e.g. Z:\aaa\1.jpg needs to become aaa\1.jpg Im tried this but its not working [CODE]sImagelink = mid(request.form("Imagelink"),4,len(request.form("Imagelink")))[/CODE] any ideas? | |
Hi I need a help in SQL,There is table called sales.Its contains the day,sales quantity.If I write sql like below [CODE]select day,Sales_quantity from Sales.[/CODE] Then result should be Day SalesQuantity Monday 20 Monday 302 Monday 50 Tuseday 30 etc.. The problem is I want to get result like below Day … | |
Hi all... So, I am needing to sum all billable hours within a table... the problem is that it is returning rouded decimals instead... like .5 always comes back as 1 ... Here is my procedure: [CODE] Public Shared Function GetBillableTimeForTicket(ByVal SupportTicketID As Integer) As Decimal Dim conn As New … | |
Hi, this is giving me a major headache and my boss wants the project wrapped up asap : / I have two views pulling data from several tables. The end result is this: CustomerTotals CustomerID numeric(18,0), ProductID numeric(18,0), Delivered numeric(5,0), Ordered numeric(5,0) SupplierTotals SupplierID numeric(18,0), ProductID numeric(18,0), Delivered numeric(5,0), Ordered … | |
Good Day all i have the Following Query [CODE] DECLARE @CurrentTime DATETIME SET @CurrentTime = CURRENT_TIMESTAMP select tr.Descr [Room], tb.Purpose [Purpose], tb.Description [Description], convert(varchar,datepart(hour,tb.starttime))+':'+convert(varchar,datepart(minute,tb.starttime)) [Start Time], convert(varchar,datepart(hour,tb.endtime))+':'+convert(varchar,datepart(minute,tb.endtime)) [End Time], tu.name [Requested by] from tbl_booking tb inner join tbl_resource tr on tb.resources = tr.id inner join tbl_user tu on tu.id = … | |
I am trying to write a bulk import routine so that i will be able to import text files or csv files to SQL i have tried this and it's giving me the following error message. P: is the drive where the file is in currently. [CODE] USE [XYZABQ] GO … | |
Dear all, I’m stuck on a problem which I’m hoping someone might be able to help with in an SQL script. I have a table with RAW Timesheet data which includes entries for Absences. When someone enters a timesheet on a particular date for a two week holiday, if I … |
The End.