services column


suppose I want to a store in a table a column that will store services provided by a service provider.
But I do not want to a separate row for each service, (because each row will be assigned to a separate service provider).

I want the services listed in one row, for the reason I mention above. What kind of column type
that could be
Posted On: Sunday 30th of December 2012 10:51:18 PM Total Views:  217
View Complete with Replies

RELATED TOPICS OF Microsoft SQL Server PROGRAMMING LANGUAGE




Using a calculated column in the same query

Hi all I'm sure this has been asked before but I can't find any obvious answers. This query doesn't work; I'm going to try a subquery but is there a better way to achieve this Code: SELECT DISTINCT ID , sum (charge1) + sum (charge2) + sum (charge3) - sum (refund1) AS revenuetotal FROM contracts WHERE date BETWEEN '2012-04-01' AND '2012-04-30' AND revenuetotal != 0 AND customerid='123' GROUP BY ID
VIEWS ON THIS POST

78

Posted on:

Thursday 25th October 2012
View Replies!

How to select all but only display certain columns of a table in sql

, I need to run a query on a table that several of the columns but only display the first name last name and office number in a dropdown list. I need to retrieve the other columns because the additional fields will need to be posted to a new table based on the users selection from the dropdown box. I am having trouble with the query. This is what I have: Select LastName + ' ' + FirstName + ' ' + 'office ' + ' ' + Company AS Agent, AssociateCell,Email From tbl1 Where Inactive = '0' AND Role ='agent' Order By LastName I need for the last name, first name and office number to be displayed in the dropdown list as 'Agent' but once the user chooses one I need for the 'Agent' "AssociateCell and Email to post to a new table. Any assistance would be greatly appreciated.
VIEWS ON THIS POST

52

Posted on:

Thursday 25th October 2012
View Replies!

Multiply all columns in a table with other column

, I have a problem with multiplying columns in one of my tables with another column from another table. This is some example code (VBA) to illustrate my problem: "SELECT [T-Bills]*[USD],[Treasuries]*[USD],[Credit]*[USD],[Equities]*[USD]" & _ " ,[Commodities]*[USD] FROM [" & ds & "] ds " & _ " INNER JOIN [CPI] cpi ON ds.date = cpi.[date]" Where [" & ds & "] is the table that consist of the asset classes. As you can see, I multiply my asset returns with the US CPI. Now I have to write out all the names of the columns and multiply all of them with US CPI. I want instead to be able to select the entire table and then multiply that selection with US CPI. Then I don't need to manually write all column namnes in the code. Something like this: SELECT * FROM [" & ds & "]*[USD] INNER JOIN [CPI] ON ds.date = cpi.date This code does not work, I know, but how would I go about to make something like this that would work
VIEWS ON THIS POST

115

Posted on:

Thursday 25th October 2012
View Replies!

Alter a column with default value

Here is my code: ALTER TABLE advert ALTER COLUMN Counter INT NOT NULL ADD CONSTRAINT [DF_Advert_Counter] SET DEFAULT ((0)) And it hit this error: Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'CONSTRAINT'. Any expert here knows what's wrong with the code
VIEWS ON THIS POST

55

Posted on:

Thursday 25th October 2012
View Replies!

Converting a comma seperated field to a column

Hi , I'm new here, tried searching for the answer but found nothing. I have a table that has a field of Strings seperated by a comma and need to transfer that to a table with those values in a single column. Example: ExistingTable heading Names - entry 1 (James4, Sam-45, 341-Carl, J4-Dan-1); entry 2 (J4-Dan-1, Steve234, Joe10-4, James4); etc. ---> NewTable heading Name - entry 1 (James4); 2 (Same-45); 3 (341-Carl); etc. Once I get this information, I can use the new table to link information elsewhere. Thank you for your time/help! Justin
VIEWS ON THIS POST

69

Posted on:

Thursday 25th October 2012
View Replies!

MAX() value of datetime column against a part of a multivalued param string (SSRS)

According query ------------------------------------------------------- SELECT MAX( CONVERT(datetime, dbo.GetRoundedDateTime(tblA.tTime, @TimePartID), 20) ) AS tLastWeighingTimeConverted ,tblP.cCode AS cPC FROM tblA JOIN tblB ON tblB.ID = tblA.iB JOIN tblT ON tblT.ID = tblB.iT JOIN tblL ON tblL.ID = tblT.iL JOIN tblP ON tblB.iP = tblP.ID WHERE ( @LC is NULL OR tblL.cCode = @LC ) AND ( @PC is NULL OR tblP.cCode IN ( SELECT ExtratedPC FROM dbo.TablePC( @PC ) ) ) GROUP BY dbo.GetRoundedDateTime(tblA.tTime, @TimePartID) ,tblP.cCode ORDER BY dbo.GetRoundedDateTime(tblA.tTime, @TimePartID) DESC ------------------------------------------------------- I expected to get a 4 rows table returned: each row the MAX value of tLatestRecordedTime against each part of the multivalued parameter string ===================================== tLatestRecordedTime(cPC = 1) (@PC =) 1 tLatestRecordedTime(cPC = 2) (@PC =) 2 tLatestRecordedTime(cPC = 3) (@PC =) 3 tLatestRecordedTime(cPC = 4) (@PC =) 4 ===================================== Surprisingly, for each part of the multivalued parameter string I get ALL recorded times (as tlatestRecordedTime) returned. Conclusion: MAX() function does not do what I expected it should do. DOES SOMEBODY know the TRICK\t Note worthy is: @PC = '1,2,3,4' a string of de multivalued parameter to be chosen in SSRS Header @LC = '1' however can be NULL (to get all LC's returned) @TimePartID = 5 (this is an internal function by which I get a rounded datetime returned in the following format: 1:yyyy-01-01 00:00; 2:yyyy-MM-01 00:00; 3:yyyy-MM-dd 00:00; 4:yyyy-MM-dd HH:00; 5:yyyy-MM-dd HH:mm; 6 and so on ...
VIEWS ON THIS POST

68

Posted on:

Thursday 25th October 2012
View Replies!

Best wait to transpose all elements of a column into ColumnFields

, I would like to know if there is an easy way to transform the following table CarId | PropertyName | PropertyValue 1 | Size | XL 1 | Name | Porsche 1 | Color | Red 2 | Size | XS 2 | Name | Smart 3 | Name | Audi into CarId | Size | Name | Color 1 | XL | Porsche | Red 2 | XS | Smart | 3 | | Audi | with MSSQL 2005 (i am using Studio Express) This a kind of crossTabling. until now here is what i am doing: I create a table why just 1 empty column (CarId) For each CarId, I put the cardId in CarId Column For each couple (PropertyName,PropertyValue) i test whether the column 'PropertyName' exists. If no, i create it then i put the 'PropertyValue' in the box (x='CardId',y='PropertyName') Thank you Julien
VIEWS ON THIS POST

26

Posted on:

Thursday 25th October 2012
View Replies!

Reporting services free?

Is there a free version of reporting services available for the sqlexpress edition of ms sql 2005 JOhn
VIEWS ON THIS POST

47

Posted on:

Thursday 25th October 2012
View Replies!

Updating a table with variable column name, retrieved from another table ?

I have 3 tables, below are their structures ( a bit of pseudo code ) I'm trying to update one table, with a variable column name, retrieved from another table order [id,field1,field2] example row ( '1' , '', '' ) produkt [order_id,produktnr] example row ( '1' , '23' ) fields [produktnr,fieldname,value] example row ( '23', 'field1', 'abc' ) Example update set order.field1 = abc (retrieve column name "field1" from the "fieldname" field in fields table, and value from value in same table, where there is a match from order.id to produkt.id, produkt.produktnr to fields.produktnr There are about 3000 rows in "order" table which need to be updated like this so I need to write a query that'll do the job... I've searched and read a lot and am finding it quite difficult but I've gathered the following It requires a mssql loop and something like the following Code: DECLARE @colname varchar(20), @colvalue varchar(20),@colid int SELECT @colname = fieldname,@colvalue = value from fields f,produkt p,order o where o.id=p.order_id and p.produktnr = f.produktnr and o.id = @ID (not sure how but need the order id here) exec("update order set "+@colname+" = '"+@colvalue+"' where id = '"+@id+"' "); I've gotten pretty far but I just don't know how to to... get the @id in the select/update statement make the code automatically get all the order id's and increment through them, setting @id for every increment I would sincerely appreciate any help....
VIEWS ON THIS POST

58

Posted on:

Thursday 25th October 2012
View Replies!

Updating a column in table B based on Max of table A

I'm a newbie so if this is a dumb questions, begging your forgivenss. The scenario (hypothetical): I have two tables: Table A. Columns: A_Key, A_Version, A-Name Table B. Columns: B_Key, A_Key, B_Name The situation is that I need to be able to update the values of A_Key in table B based on max A_Version) in table A. The need for this is all to do with forms. There are situations where the forms is edited by someone at head office and the forms needs to be transferred to a remote facility. The twist is that on editing the forms, a new version is created. So the key making the form unique is the A_Key and A_Version. Hope this doesn't sound to overly confusing. TIA. B
VIEWS ON THIS POST

46

Posted on:

Thursday 25th October 2012
View Replies!

Selecting from combined columns across tables

Here's the setup (I'll greatly simplify tables to make it easy): Category table, which can nest: CategoryID ParentCategoryID CategoryName CategoryKeywords Item table: ItemID ItemName ItemKeywords ItemCat pivot table: ItemCatID ItemID CategoryID Search terms are generally 3-4 words, such as "keychain ford leather" for example. Not all of these terms will be found in one table, it's likely a combination. In this case the category name might be "Ford Keychains" and an item name might be "Leather". The basic idea is to find all search terms in a combination of fields across tables. The pivot table makes it slightly more fun but not a major obstacle. The Keywords field in both Item and Category tables can contain alternate item/cat names that need to be searched but are not displayed (ex. keychain, keytag, key fob). Right now I have a big ugly blob of code that takes the list of fields to search (let's say Category.CategoryName,Category.CategoryKeywords,Item.ItemName,Item.ItemKeywords) and the search term and breaks it down into individual words, and builds a massive WHERE clause, looping ANDs on the search words and ORs on the fields. It works, it's huge, it's ugly, it's inefficient. Throw in the pivot table and do this across multiple categories, as well as about 4 other JOINs to some other tables searched on columns other than the search terms (Model,ModelYear etc) and it's enormous. What essentially needs to be done is "WHERE table.field + table.field + table.field LIKE 'this' AND 'that' AND 'whatever'" - Of course this would be too easy. Is there an obvious way to be doing this more efficiently No it's not indexed; the database is constantly updating and i really dont know much about full text indexing or have time to, so I'm just looking for ways to more efficiently structure the query.
VIEWS ON THIS POST

108

Posted on:

Thursday 25th October 2012
View Replies!

Sum of three adjacent columns:

[No need to reply. I've since solved this issue. But maybe this is actually a bonafide query exercise--I'd still welcome any suggestions if it is.
VIEWS ON THIS POST

36

Posted on:

Thursday 25th October 2012
View Replies!

SQL query to convert rows into column

I have detail table like date item_id grade in out ------ ------- ------- ----- ----- 01-01-08 001 A 10 0 02-01-08 001 O 8 0 01-02-08 002 O 1 0 03-01-08 001 T 0 10 02-01-08 003 O 20 0 02-01-08 003 T 0 10 02-01-08 003 B 0 8 Result View ======= Item_id A B O T Total ------- --- ---- --- --- ------- 001 10 0 8 -10 8 002 0 0 1 0 1 003 0 -8 20 -10 2 I want result group by Item_id and sum of grade in column . where grade could be any Alphabet, the column of result query could varies. Each grade contains sum of (in-out) of item_id of detail table. Smartsys99
VIEWS ON THIS POST

50

Posted on:

Thursday 25th October 2012
View Replies!

Add a column to large, busy table.

I have a table that currently holds about 5 million records. We add an average of 5,000 new records per day, all of them from overnight batch jobs. I guess it's not that big, but there are two text columns that hold a couple KB each, so the total size isn't exactly small either. The data is created from medical billing data we receive overnight. We get two reports- patient demographic information and a physician's dictation relating to that patient. This data is always one to one, and the purpose of this table is to store the data as we originally receive, which is why both reports are in the same table. After we extract the details from the report, (which are by this point always reduced to text documents) we need to keep not only the data but the original documents, hence the two text columns. We considered moving the large columns to their own table, which would just have an ID field and the column, but the powers that be really wanted all this in the same table. Nothing new goes into the table during day- it's all SELECT statements. I need to add a column to this table. It's just a small char(7) column, NULLS allowed, of course. We bill for several clients, and reports from different clients become available at different times, so there's really no down time overnight. Altering the table during the day is out of the question. So how can I add a column while the table is active My best idea so far is to use SELECT *, NULL AS NewColumn INTO NewTable to create a copy of the table (using a cast to get the correct datatype) during the day, when no new data is going in, and replacing the old table with the new by simply changing the names right after goes home. But this could still cause slowdowns while it builds the copy, and leave the problem of re-creating indexes (there are several). There ought to be some graceful way to tell it to add the column to the existing table and play nice with ongoing traffic.
VIEWS ON THIS POST

62

Posted on:

Thursday 25th October 2012
View Replies!

Query based (partly) on CSV column

I'll try to simplify the problem as much as I can. There's survey. It has different types of question answer pairs, but the problem is in Multiple Choices, Multiple Answers questions, where user can choose, for example 3 checkboxes from 5 at the web form, for the question. I am emphasizing three tables: tbl_questions IDquestion (primary) question (textual question) tbl_answers IDanswer (primary) IDquestion (foreign,to table tbl_questions) answer (textual answer) tbl_results IDresult (primary) IDquestion (foreign, to tbl_question) result (string based on CSV, may contain few IDanswers, because visitor may choose few checkboxes, for example it can be "4,6,7") Inside those tables are data (I'll put here just two questions): Example: tbl_questions IDquestion_question 1_________Which OS do you use 2_________Which databases do you use tbl_answers IDanswer_IDquestion_answer 1________1_________Windows 2________1_________Linux 3________1_________Mac OS 4________2_________SQL Server 5________2_________MS Access 6________2_________MySQL 7________2_________Oracle 8________2_________Other 9________2_________No, I do not use databases tbl_results IDresult_IDquestion_results ........ 23_______1________1,2 24_______2________4,6,7 ........ Is there a possibility to make query, using columns, but also the data inside the CSV format in results (varchar or char) column Result of the query would be: IDquestion_IDanswer_answer 1_________1________Windows 1_________1________Linux 2_________4________SQL Server 2_________6________MySQL 2_________7________Oracle Further queries based on this query should be able to make statistics (GROUP BY).
VIEWS ON THIS POST

49

Posted on:

Thursday 25th October 2012
View Replies!

XML type column

I have a column in a table that accepts xml. When I store a string from asp.net that looks like this... and then view the table in Management Studio I get (the xml declartion is missing) When I store a string like this... Server Mangements studio displays it as My question is why doesn't the
VIEWS ON THIS POST

56

Posted on:

Thursday 25th October 2012
View Replies!

Concatenate when one column is NULL

I am trying to concatenate three columns and when one column might be NULL, the result set is NULL. I have set "concat null yields null" to false and the result is the same. Here is my code: Code: SELECT lname + ',' + space(1) + fname + SPACE(1) + mname as FullName TIA Mike
VIEWS ON THIS POST

37

Posted on:

Friday 26th October 2012
View Replies!

Adding column amounts per customerID

Hi Code: SELECT C.customerID, quantity, unitprice, (SELECT quantity * unitprice), OD.productID, FROM customers C INNER JOIN Orders O ON C.customerID = O.customerID INNER JOIN [order details] OD ON O.orderID = OD.orderID ORDER BY C.CustomerID The Output looks a little like this: Code: customerID quantity unitprice productID ---------- -------- --------------------- --------------------- ----------- ALFKI 15 45.6000 684.0000 28 ALFKI 21 18.0000 378.0000 39 ANATR 1 28.8000 28.8000 69 ANATR 7 9.2000 64.4000 19 ANATR 10 34.8000 348.0000 72 ANTON 24 16.8000 403.2000 11 ANTON 15 46.0000 690.0000 43 AROUT 25 3.6000 90.0000 24 AROUT 16 19.0000 304.0000 36 BERGS 16 15.5000 248.0000 44 BERGS 15 44.0000 660.0000 59 BLAUS 3 10.0000 30.0000 21 BLAUS 21 34.0000 714.0000 60 BLONP 35 12.5000 437.5000 31 BLONP 15 19.5000 292.5000 57 BOLID 24 17.6000 422.4000 4 BOLID 16 15.6000 249.6000 57 BONAP 40 36.8000 1472.0000 43 BONAP 20 7.7500 155.0000 75 BONAP 8 30.0000 240.0000 7 BONAP 20 6.0000 120.0000 13 BONAP 20 25.0000 500.0000 6 BONAP 20 23.2500 465.0000 14 BONAP 10 9.2000 92.0000 19 BOTTM 16 24.8000 396.8000 10 BOTTM 9 46.0000 414.0000 43 BOTTM 30 4.5000 135.0000 24 BOTTM 21 49.3000 1035.3000 62 BOTTM 15 2.5000 37.5000 33 I would like to add the totals from each customerID and then show the customerID once with the final total amount. The above SELECT statement was the closest I could come. The help is always appreciated! Justin
VIEWS ON THIS POST

72

Posted on:

Friday 26th October 2012
View Replies!

search a column of comma delimited numbers (was "help with sql query")

I need to search a column in my database (varchar:50) that contains a comma delimited string of numbers (i.e. 1, 2, 3, 4, 5, 10). Currently, I am doing the following SQL query: SELECT * FROM people WHERE clubs_belongs_to LIKE '%1%' Where 1 is the number I'm searching for. The problem with the query above is that it returns records that contain 1, 10, 11, 12, 13, etc. in the clubs_belongs_to field. I want the query to only return those people who belong to club number 1, not 10, 11, 12, etc. Please help.
VIEWS ON THIS POST

100

Posted on:

Friday 26th October 2012
View Replies!

add checkbox column to access table (was "SQL query help.., please, any one??")

good people of this forum.. I am working on an eccess db, and using asp to update, change and so on... I want to add dynamicly a field to the db, using the ALTER TABLE command, but for some reson I can't find a way to make it work, the field type I am trying to add is boolean, and I want it to show up in the actual db as a checkbox, and not as a bit field (0/1), so I've been trying this and non of them work, and I couldn't find any sites with examples for this... any help would be very appricated..., this is what I've tryed so far and didn't work: "ALTER TABLE [Users] ADD [CHILD] boolean" "ALTER TABLE [Users] ADD [CHILD] boolean False" "ALTER TABLE [Users] ADD [CHILD] boolean(f)" "ALTER TABLE [Users] ADD [CHILD] boolean f" me out on this\t
VIEWS ON THIS POST

216

Posted on:

Friday 26th October 2012
View Replies!

install analysis services 2000 on windows 2003 pdc

i'm running windows 2003 enterprise with sp1. and i'm trying to install sql server 2000 enterprise and analysis services 2000 enterprise. this is more of a dev system, but it's giving me this error msg when i try to install sp3a for analysis services: "An error occurred during the move data process: -132" i had both sql server and analysis services installed on the pdc before, and i then upgraded to sp3a. but this time, i can only installed sql server with sp3a, but it wont take the upgrade for analysis services no other errors show up in the event viewer on the local system... can someone give me some help on this thanks nevermind, i got it. it's somekinda bug in the installer i guess. had to delete the file msmdsrv.exe in the bin folder for analysis services. the service pack then installed a new version, and it seems to work now :-)
VIEWS ON THIS POST

55

Posted on:

Friday 26th October 2012
View Replies!

"No such column" error

I'm converting the SQL statements from Oracle to MS SQL Server in the Java program.I'm getting the following error : java.sql.SQLException: No such column count(*) at the LAST STATEMENT of the following piece of code - strQuery = "Select count(*) from PS_FISC_PNLG_LIST"; rset = m_databaseConnector.execQuery(strQuery); if(rset.next()) nCnt = Integer.parseInt(rset.getString("count(*)")); Whats the correct substitute for this stmt in SQL Server Please help.
VIEWS ON THIS POST

62

Posted on:

Friday 26th October 2012
View Replies!

Finding real name for column alias

Not sure if this can be done, but you are a clever bunch. I am looking for a way (preferably through a stored procedure) to return the original column name for an aliased cloumn. For example, I have a table view like: "SELECT id, firstname, lastname, qty as Amount FROM tblTeam" Returned columns are id, firstname, lastname, Amount. I would like to look up the results returned by the view, and get a list of the ORIGINATING columns (eg. id, firstname, lastname, qty) from the returned data. I am using php script to run stored proc.
VIEWS ON THIS POST

79

Posted on:

Friday 26th October 2012
View Replies!

Convert multiple rows into multiple columns

I need to push multiple rows of data from one table to one record in another table. This can be achieved using cursors but I need to do them without using cursors. Source Table: fld_name fld_value fld1 val1 fld2 val2 fld3 val3 fld4 val4 Destination should be like this: fld1 fld2 fld3 fld4 val1 val2 val3 val4
VIEWS ON THIS POST

69

Posted on:

Friday 26th October 2012
View Replies!

renumber an ID column

, I've a ID column like this: IDcol | Name 273 | namexxx 274 | name xxx 276 | name1 277 | name2 278 | name3 279 | name4 279 | name5 I wish to rename the IDcol filed with -1 to have this: IDcol | Name 273 | namexxx 274 | name xxx 275 | name1 276 | name2 277 | name3 278 | name4 279 | name5 How can I do that into MSSQL I appreciate your help and time.
VIEWS ON THIS POST

65

Posted on:

Friday 26th October 2012
View Replies!

Selecting Distincts from one column, returning all columns....

Familiar, but new to Access. Trying to get multiple columns returned based off of one distinct column. Here goes: Name Email Newsletter Bob URL News1 Bob URL News2 Dave URL News1 Dave URL News2 Steve URL News3 I need to do a query that returns Name Email Newsletter Bob URL News1 Dave URL News1 Steve URL News3 Basically, a query off of the email column that returns all the distinct entries, but will also return the other columns as well. Every time I run a DISTINCT, I only get the email column. Also, I don't care what is in the newsletter or name fields. They can be anything, I just need the first one.
VIEWS ON THIS POST

84

Posted on:

Friday 26th October 2012
View Replies!

Set "Password" column in MS SQL

Hi I am kinda new to MS SQL. I have used Oracle before but it is not quite the same. I want my password field in the database to appear as "*****" not "hello". How do you set fields to be password fields There is no "password" data type and it doesn't seem possible to define a user defined data type to appear as password "****" field
VIEWS ON THIS POST

81

Posted on:

Friday 26th October 2012
View Replies!

Unique values (except Null) in a non-unique column

We've have a couple of fields in our Database that must contain unique values. However, we also need to be able to have these fields set as null if no value has been set. At the moment if you set the field so that values must be unique it only allows a single null value. Does anyone know how I can get around this problem. Tia, Andy Jones.
VIEWS ON THIS POST

77

Posted on:

Friday 26th October 2012
View Replies!

Search and Results using multiple columns

I have a DBTable named Vendors which includes the following columns: CompanyName (Name Here) SBI (Yes, No) MBE (Yes, No) SBI (Yes, No) WBE (Yes, No) I'm trying to do a search on Vendors where either SBI or MBE or SBI or WBE is equal to 'yes' and then order by company name. I'm lost on both the search and the results code. I'd like to have a drop down for the search like this: Show all Vendors who are: SBI SBE MBE WBE Any ideas on how to make this work would be greatly appreciated.
VIEWS ON THIS POST

130

Posted on:

Friday 26th October 2012
View Replies!

Newbie question?

Hi. When using enteprise manager and clik properties on the newly database file it says file size: 30 Mb - Space available 3 mb. What is ment by "space avaliable" Cant the mssql file be more than 33 mb\t Bjorn.
VIEWS ON THIS POST

56

Posted on:

Saturday 10th November 2012
View Replies!

set variable in stored procedure

can I set a value to a variable when the table name and the column are variable I tried this way and got an error... select @cur_max_value = MAX(@cur_field) FROM @cur_table
VIEWS ON THIS POST

62

Posted on:

Thursday 15th November 2012
View Replies!

SQL Server 2000 - Move databases to new site

I want to move 8 databases from sql server that support my website to a new ip address,new sql server ... Can i export the database as a package and ftp to the new site then import it .. I tried the DTS but i didnt help me much ..is there a way, if it is DTS or copy database or backup and restore ... please illustrate
VIEWS ON THIS POST

59

Posted on:

Tuesday 20th November 2012
View Replies!

Procedure

hi.. i have one holiday master where all holiday are defined..now in below cursors i want to add payoutday to my trade_day.and this date will insert into my funding table.but before that i have to check after adding payoutday to the trade_day, this date not fall in holiday list.if that day will holidat than i have to take next working day.and agaim next day also holiday than i want to skip that day also and take next working day...so on. how to do this Code: declare @redemid int, @scheme_group varchar(50), @trade_date DateTime, @amount numeric(9), @Account_CollectAC varchar(50), @PayOutDay int --Cursor declaration----- declare InsertFunding cursor for Select Redemption_Upload_Master_ID,scheme_group,trade_date,amount,Account_CollectAC from #MatchedFile -----Open cursor---------- OPEN InsertFunding ----Fetch into variables----------- fetch next From InsertFunding into @redemid, @scheme_group, @trade_date, @amount, @Account_CollectAC, @PayOutDay while @@fetch_status = 0 begin insert into tbl_account_funding (Redemption_Upload_Master_Id,scheme_group,schemegroup_accode,trade_date,credit) values(@redemid,@scheme_group,@Account_CollectAC,@trade_date,@amount) fetch next From InsertFunding into @redemid, @scheme_group, @trade_date, @amount, @Account_CollectAC END close InsertFunding deallocate InsertFunding End
VIEWS ON THIS POST

16

Posted on:

Tuesday 20th November 2012
View Replies!

ALTER SQL command required

i'm new in this database. I wanna know why this error (ALTER SQL command required)not allow me compile. I did not made this procedure but my boss want add something. What's the problem Code: Use [Poncio] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[PONCIO_PAGO]
VIEWS ON THIS POST

62

Posted on:

Tuesday 20th November 2012
View Replies!

Delete related records from different tables

I have two tables with records that are related to each other. Say in table1 there's a field called UserID and in table2 there's a corresponding field called User. Using a SELECT statement, I can connect corresponding records from these two tables using the JOIN function. Code: SELECT table1.UserId, table2.User FROM table1 JOIN table2 ON table1.UserId = table2.User But what if I want to delete a record from table1 and its corresponding record from table2 Code: DELETE FROM table1, table2 WHERE table1.UserId = 40 JOIN table2 ON table2.User = table1.UserId Now that is an incorrect syntax of course, but I hope you understand what I'd like to achieve.
VIEWS ON THIS POST

60

Posted on:

Tuesday 20th November 2012
View Replies!

Help

I am totaly new to SQL so any help would be a big help. I am trying to creat a small datbase the table I can make ok but having trouble getting the data to work: *****This bit worked OK**** Create table Branches ( PKBranch int, BranchName Varchar, BranchAddress Varchar ) ****This bit will not work ***** insert into Branches Values ( 1, 'Birmingham', 'Harborne Birmingham B17 0LU' ) The error message is: Server: Msg 8152, Level 16, State 9, Line 1 String or binary data would be truncated. The statement has been terminated.
VIEWS ON THIS POST

18

Posted on:

Tuesday 20th November 2012
View Replies!

Urgent help with pie chart report

Any body can help to create a pie chart report with Sql server Reporting services. I like to pay $100. See detail from http://www.e2xpert.com/project.aspprojectid=10171
VIEWS ON THIS POST

123

Posted on:

Tuesday 20th November 2012
View Replies!

Getting databases available on Server

I have the SERVER name as a variable and I need to get the databases list on that server into a drop down. How can it be done\t
VIEWS ON THIS POST

301

Posted on:

Tuesday 20th November 2012
View Replies!

display 2 field in 1 record

Thanx for your help!! Can I display 2 fields in 1 record. i.e I have a table ====================== prodname prodbrand x abx y asd z abx ====================== Can I display it like ====================== x y z abx asd abx Thanx a lot..
VIEWS ON THIS POST

59

Posted on:

Tuesday 20th November 2012
View Replies!

A Message from Jim Boykin, New Owner of Developer Shed

Developer Shed Community Members, My name is Jim Boykin, and I'm the very proud new owner of the Developer Shed network of sites. I am here to serve you, the users, and to work to make each property several times more useful than they are today. It's all about you, the users and the community. Even though I wasn't elected for this position, I am still asking for your support in taking each site to new levels of usefulness and to grow the communities...they can grow a lot, if together we help to make these great communities. For years I've had this dream....a dream of making these properties wonderful resources for the users of the communities again. Now I have that chance, but I can not succeed without your support and your help, and your patience, and your faith in my intentions for these sites. My intentions are to make the sites way more user friendly, and to build up great communities that can be proud of. My goals also include fixing, replacing, and adding new tools for the sites. As the owner whom is responsible to these communities, I pledge to work to serve all visitors a better user experience, better information, better tools, and even better communities. I also pledge to listen to the communities, and to respect the views and wishes of each community, and to do what I believe is best for each community based on the wishes of the community, using the resources that I have available. I understand that without your support, and without your sharing, and without your contributing to the community, that these wonderful websites and communities would die like a ghost town...but I also understand that we can work together towards making these sites and communities a much better place....a place of great value to the users (all of YOU) ...together, I believe we can create a place where can be proud to say they are a member of, and where information can be shared without being bombarded with advertising... for that is the core of what I'm striving towards. Now that I have been given this chance to lead, you can be assured that I'll work to do what is best for the communities first before I look at what is best for my wallet. If there is to be advertising on the sites, then it has to be relevant, and quality, and of use to the users...and not in their face taking away from the trust and usability of the site. If I give the users quality information, and quality tools, and quality communities....then I truly believe that this acquisition will, over time, give back in business karma. I don't have to spam the users. We are about to upgrade these communities to a much newer version of vBulletin, and working to restructure the content so that it best serves the user on the website. Once we reach that stage, we can start looking at suggestions from that version. We'll be working on them, the best we can, as fast as we can, but it won't be overnight...if each day we get a little better, we'll be the Best by this time next year. I would like to thank who has helped to keep these sites wonderful resources throughout the years. I'll do all I can to value and honor all of you for helping to make these sites have quality information updated for so many years. I'd like to thank the wonderful folks at the Developer Shed office (Jenny, James, Terri, Charles, and Eric). You are Awesome! Over the years your team has held together into one tight solid group that is all about doing all you can to make the sites better...even though your hands were tied in so many areas, and the higher up corporate people had goals that didn't mesh with how to best treat the community, you held together, doing all you could for the sites...I know you all deeply care for the properties, and I pledge to you to do all I can to help your team in transforming these communities into a greatness that you've all dreamed for these sites, and now we can start taking steps towards this greatness together. I'd like to thank all the Admins and the Moderators of each community as well. Without your direction, and editing, there would be anarchy. I thank you for taking on these responsibilities, and for helping to keep the communities places where knowledge can be shared in an organized way. I understand that you're not getting paid, and you're only going to do these tasks if you want to...and I'll do all I can to continue to have you want to help make these great communities even better with your help...my goal will be to make you prouder than ever to say that you're an admin or moderator of your community. I would also like to thank all the Millions of registered users who have contributed millions of threads and tens of millions of comments over the years. I will do the best I can to serve you and each of these communities. I will strive to keep as many of you happy as I can from today onward. You are the Community and I am here to answer to you. I know that many of you have seen changes over the years....some changes that were not so good...but know that I'm working hard to "Give these sites back to You...the users, and to the community as a whole." I'm Feeling Lucky, Jim Boykin CEO and Founder of Internet Marketing Ninjas And Owner (Responsible to the Community) of Developer Shed Twitter Blog Facebook
VIEWS ON THIS POST

60

Posted on:

Monday 26th November 2012
View Replies!