3,481 Topics

Member Avatar for
Member Avatar for ManthanB

as title itself is saying what i am looking for over here. I formatted my pc and installed Sql server 2005. I detached db before formating the system and attached after formating. however after attaching i am getting Db in recovery/ readonly in object explorer. I tried to change properties …

Member Avatar for Reverend Jim
0
159
Member Avatar for krunal1986

Hi All, i have requirement like to Convert rows to columns in SQL server. i have retrieved data like below: MatchId SelectionName Odds 322 Home Win 1.33 322 Draw 5.00 322 Away Win 9.00 322 Under 2.5 2.40 322 Over 2.5 1.53 and want to convert like below: MatchId Home …

Member Avatar for urtrivedi
0
352
Member Avatar for Maideen

hi I tried to generate ageing reports in php. But I could not get result and even error. it is my code. Pls help me connection.inc.php try { $hostname = "server"; //host $dbname = "database"; //db name $username = "user"; // username like 'sa' $pw = "password"; // password for …

Member Avatar for Maideen
0
553
Member Avatar for draven07

Need help! As you can see, I'm working with a crosstab report that will display the product's "Total Sales" or "Quantity Sold" on a particular year in a monthly basis. Now my problem is, I can't figure it out how I can display the monthly total sales or quantity sold …

Member Avatar for LastMitch
0
224
Member Avatar for Stuugie

Hi All, I'm a little stuck with one table's design. I have a table called tblConference_Board that will be updated approximately 3 to 4 times per year. The following is my table design: `CB_ID int (PK)` `CB_Mnemonic_ID int (FK)` `CB_Value decimal (18,10)` `CB_Year int` `CB_Quarter int` This table is loaded …

Member Avatar for Reverend Jim
0
242
Member Avatar for Stuugie

Hi All, I have a table that holds monthly data in it. I need to average that data into Quarterly and Annual data but I'm not sure how to go about that. For annual I tried something like: SELECT TOP (100) PERCENT b.vSeries_Type as [Description],b.vSeries_Number as [CANSIM], Year(a.IPI_Ref_Date)as [Year], avg(a.IPI_Value) …

Member Avatar for Stuugie
0
150
Member Avatar for de Source

hi i am new to sql i want to get some values from different tables and i have made my own logic like that "SELECT course_name, course_id FROM tbl_course WHERE course_id = (SELECT course_id FROM tbl_enrollment WHERE student_id = '" + lbl_StudentID.Text + "')" what could the correct sytax for …

Member Avatar for de Source
0
252
Member Avatar for sparksguy

i am trying to make this code work with no success. Can anyone help me? ` $to = $_POST["credits"]; $messaging = $_POST["message"]; $sub = $_POST["subject"]; @mysql_query("INSERT INTO `mp_creditmail` (`Id`, `message`, `subject`, `read`) ('select Id from oto_members ORDER BY RAND() Limit $to;', '$messaging', '$sub', no");` i am trying to insert several …

Member Avatar for sparksguy
0
217
Member Avatar for bios chips

please help me. i connected two system using a cross over cable, and was able to see the remote servers in both systems but i am experiencing a connection problem to the remote computer. how do i connect to the remote sql database server? and how do i replicate between …

Member Avatar for JorgeM
0
144
Member Avatar for JACOBKELL

I need to convert mysql class of one script to make a support for sqlite,but problem is sqlite dont have username/password thing nor database select as well,which means how some parts need to be removed.If i would convert to mssql one search and replace probaly would do the job.There is …

Member Avatar for cereal
0
240
Member Avatar for ndeniche

With the constant growth of NoSQL databases, wouldn't it be convenient if Daniweb had a nosql forum? Maybe not specialized forums like MSSQL, MySQL or Oracle, but a general forum for NoSQL database systems.

Member Avatar for Reverend Jim
0
361
Member Avatar for Stuugie

Hi All, I sort of want to get a "best practices" perspective regarding numeric values. First, I'll give my scenario: In my SSIS package, a CSV file is used for data extraction. Once extracted, a staging table is loaded with all the values from the CSV. One column, called "IPI_Value" …

Member Avatar for Stuugie
0
165
Member Avatar for nice_true

Hi, Does anyone know how to pass table name as parameter in a cursor? ALTER PROCEDURE [dbo].[error_calculation] @tablename nvarchar(50) AS DECLARE @part_no nvarchar(50) --Current Year Cursor DECLARE db_cursorpartno CURSOR FOR select distinct part_no from @tablename ///This gives error OPEN db_cursorpartno FETCH FROM db_cursorpartno INTO @part_no

Member Avatar for pritaeas
0
123
Member Avatar for jrosh

Can I get data from two databases (in same database server) to a c# project. How to include two edmx files? Or is there another way? Thank you in advance

Member Avatar for jrosh
0
86
Member Avatar for Stuugie

Hi All, I'm working on filling a user variable called "EmailString" via a db connection with SSIS. I've created a script task to do this (the only way I can see how) and in it I have the following code: Public Sub Main() ' ' Add your code here ' …

Member Avatar for Stuugie
0
299
Member Avatar for Papa_Don

Hi Group! I've created a stored SQL procedure that will need to be modified to lock the table, run the commands and then unlock the table. I need to do this because I want any other users/programs that will need access to "wait in line" until the procedure is finished. …

Member Avatar for Papa_Don
0
1K
Member Avatar for Maideen

Hi I am not familiar with ajax. pls help me how i can do in script Below my script and using pdo and mssql 2005. Below script working fine. But everytime change the details, page refresh and display is delayed Pls help me --------------------------------------------------------------------------- index.php ---------------------------------------------------------------------------------------------- <?php include_once '../inc/connection.inc.php'; ?> …

Member Avatar for ndeniche
0
280
Member Avatar for taekiewzz

I have a table called `DUTY` (columns: `dutyid, dutyname, staffid`) and a table called `STAFF` (columns: `staffid, staffname`) In order to be fair, each of the staff will be auto assigned to each duty entry (record). So what should I do whenever I would like to insert a duty entry, …

Member Avatar for pritaeas
0
253
Member Avatar for Lethugs

Hi Im working with a project, simple IM for our office... I have a Table in sql with column Status, if a user opens this application, the status column changes from 0 to 1, if it closes this app, the status turn back to 0. On my form load event, …

Member Avatar for Lethugs
0
282
Member Avatar for jrosh

CAn i use 'waitfor' in t sql in sql server 2012 to wait in terms of days? eg. Wait three says after an event to do something else? Thankx in advance

Member Avatar for pritaeas
0
93
Member Avatar for gumbi17

I am moving from database from Microsoft Access to MS SQL and I have not worked with MSSQL before, can you recommend a good place to get some initial and then follow on training in SQL and MS SQL?

Member Avatar for Reverend Jim
0
520
Member Avatar for Dazzler123

Hello! I need some help with a stored procedure for insert. I know this might sound stupid but I'm a beginner and I know the answer is there but I just can't find it. I've searched the site but I couldn't find an answer to clear me out ...or maybe …

Member Avatar for pritaeas
0
204
Member Avatar for spowel4

I have a table with several columns, the two relevant columns for what I need to do are invoiceNumber and stockNumber. The scenario here is that it's a table of invoice information, so each invoice can have and will most likely have multiple rows in the table which represent each …

Member Avatar for spowel4
0
152
Member Avatar for Kmhnz201

I was trying to update an existing data and this error message came up. Does anyone know what this error message means? Fatal error: Uncaught exception 'fSQLException' with message 'MSSQL error ([Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of PRIMARY KEY constraint 'aaaaaPatient_PK'. Cannot insert duplicate key in object 'dbo.patient'. The …

Member Avatar for paulkd
0
167
Member Avatar for Deeksh
Member Avatar for Deeksh
0
156
Member Avatar for Markie76

Hi, Can anyone help me with my CASE statement update on a temp table. In my report I have the following case statement; 'STATUS' = CASE WHEN customer = 'BUS' AND country = 'GB' AND field_1 = 'X' THEN 'UK_BUS' WHEN customer = 'BUS' AND country <> 'GB' AND field_1 …

Member Avatar for IIM
0
174
Member Avatar for Wolxhound90

Hi Guys, I have a problem using the sqlsrv_connect function (in that it's failing!). I have been using mssql_connect on a server with an older verison of PHP where my connect string worked fine. But putting the information into the sqlsrv_connect doesn't let it connect. Here's my code that I …

Member Avatar for Wolxhound90
0
427
Member Avatar for Himanshu Chawla

while ( select AVG(Rate)+2 From HumanResources.EmployeePayHistory) <20 begin update HumanResources.EmployeePayHistory set rate=rate+2 From HumanResources.EmployeePayHistory if(select MAX(Rate)+2 From HumanResources.EmployeePayHistory)>127 break else continue end **I have Execueted this query but I am Not able to know what is this query working ? what is the use of this query ?? it will …

Member Avatar for akkbkht
-1
172
Member Avatar for jrosh

What is the procedure can be used in MS-SQL server 2012 in order to create a workflow as in dynamics CRM? Is there a way. Or what is the alternative? Thnakx in advance.

Member Avatar for jrosh
0
94
Member Avatar for jrosh

I have an assignment where i should demonstrate concurrency controls.In order to do that i should work with two sessions in the same database in ms sql server. How can i do that.

Member Avatar for jrosh
0
136
Member Avatar for gargkapil2008

Hi, I want to copy records of a table say employee into the same table. For Example Table Employee contains 5 records. So i want to insert the same 5 records again into the same table Employee 20 times. I have tried the following Query (which is inserting records in …

Member Avatar for adam_k
0
192
Member Avatar for gbhs

Hi to all, As a newbie, I am not able to have the following columns into a datagrid. (see database diagram attached) (I don't want to select ID columns because users may not be able to identify the students). I don't master JOINS . Infact I want to select all …

Member Avatar for gbhs
0
313
Member Avatar for Papa_Don

Hi group, I'm still learning Visual Basic and SQL. Please overlook my inabilities. I'm writing a module that is meant to write a small amount of data to a database. I've named these fields 'PrinterID', 'PrinterName', 'PrinterNumber', 'PrinterLocation' and 'PrinterAddress'. The user will eventually have 30 or 40 records to …

Member Avatar for Papa_Don
0
2K
Member Avatar for AmrMohammed

Greetings, I have a table which contains product information called Products contains fields: ProductID, ProductName, and another table called UnitsInStores contains fields: StoreID, ProductID, UnitsNumber, UnitPrice My first question is: Is it better design to put the UnitPrice field within the Products table or to put it within UnitsInStores table …

Member Avatar for AmrMohammed
0
264
Member Avatar for ManthanB

Well i am having an interesting thing to discuss with you all people. i am having table in database where one column is having xml data with certain fields. I want to fetch those field using select query. So tell me if you can suggest something to me. Thanks a …

Member Avatar for ManthanB
0
238
Member Avatar for aruprongs

Hi, So i have a table called Resource in SQL in MS ACCESS,which has a field called Resource_Type which has values Permanent and Contract, what i'm trying to do is get the count of the number of permanent and contract employees so as to display it's ratio. This is my …

Member Avatar for Reverend Jim
0
105
Member Avatar for waqar100

I have approx 80 rpt files ,the client want to convert them in to ssrs, is there any free tool?client using mssql 2008R2

Member Avatar for LastMitch
0
96
Member Avatar for deolalkar_pooja

Hi to all, I want to install SQL SERVER 2008 on my XP 32-bit OS. After clicking on "New SQL Server stand-alone installation or add features to an existing " link unser installation tab, Setup Support Rules window shows success status of all rules except "Restart Computer". It neither directly …

Member Avatar for cyberdaemon
0
260
Member Avatar for roseann.larrosa

Please help me im new in making database i dont know what tables will i create and its content pls.. 1. Develop a database design for a Student Attendance Management System. Create an ER Diagram to illustrate the relationship between the entities in your database. Below are the suggested list …

Member Avatar for Reverend Jim
0
7K
Member Avatar for Eager_Beever

I am trying to implement a Login validation using C# 2005 in ASP.net 2.0 web application. The SQL Server database contains a table named "UserList" with columns LoginId, Password and Role. The Login webform should authenticate the LoginId and password and depending upon the Role assigned to that user/visitor should …

Member Avatar for LastMitch
0
211
Member Avatar for nice_true

Hi, I would like to know how to find duplicate records based on exact match on some columns and slight difference on others... for example, I have a table with the following fields 1. Name nvarchar(50) 2. City nvarchar(50) 3. State nvarchar(50) 4. Age int(10) Now, I wish to search …

Member Avatar for pritaeas
0
191
Member Avatar for Evil_genius82

Hi all, I have a database with a set of relations created in SQL Server express. Is it possible to view or recreate the sql statements that created the database? Thanks for your time. Ryan

Member Avatar for Reverend Jim
0
182
Member Avatar for neilelph

Hi. I have taken over the maintenance and development of an application created using C# in Visual Studio 2010 that makes use of an edmx file to provide mapping to a database (Microsoft SQL Server Compact 4.0). The database itself holds only tables with columns but no data at the …

Member Avatar for pritaeas
0
158
Member Avatar for Andrew de Beer

Hi All I am upgrading a SQL 7 database to SQL2008 R2 and just cannot undestand why 2008 has a problem with the code for this view (my experience with SQL 2008R2 is limited): SELECT dbo.tbl_orgbusinessunits.BusAreaCode, dbo.tbl_orgbusinessunits.Region, dbo.tbl_orgbusinessunits.CompanyCode, dbo.tbl_orgbusinessunits.BusAreaCode & ' ' & dbo.tbl_orgbusinessunits.BusinessAreaName AS Branch, dbo.tbl_orgcompanies.CompanyCode & ' ' …

Member Avatar for JorgeM
0
170
Member Avatar for jrosh

I have a trigger on insert CREATE TRIGGER [dbo].[InsertNewCustomersAsGroupMembers] ON [CustomerBase].[dbo].[Cutomers] AFTER INSERT AS BEGIN SET NOCOUNT ON; -- Insert statements for trigger here DECLARE @inserterdCustomerID uniqueidentifier UPDATE [CustomerBase].[dbo].[GroupMembers] ?---? END GO I want to get the values of the inserted record at [CustomerBase].[dbo].[customers] into the trigger inorder to update …

Member Avatar for jrosh
0
191
Member Avatar for pearl.kumar1

Hi to all, I try to insert a values in SQLSERVER 2005,It shows "Msg 544, Level 16, State 1, Line 1 Cannot insert explicit value for identity column in table 'designation' when IDENTITY_INSERT is set to OFF." BEGIN TRAN INSERT INTO DESIGNATION (ID,DESIGNATION) VALUES(17,'TEST') COMMIT Kindly Suggest How to Solve …

Member Avatar for pearl.kumar1
0
100
Member Avatar for cplusplusgeek

I have an entity named Country with fields: CountryID, CountryName where CountryID is a primary key. And i like to create a general stored procedure that does INSERT, UPDATE and DELETE operations. How can i do that?

Member Avatar for Reverend Jim
0
2K
Member Avatar for cooling

SELECT Facility.[Facility Name] FROM Facility LEFT OUTER JOIN Reservation on Facility.FacilityID = [Reservation].FacilityID AND [Check-in time] = '" & Integer.Parse(cboHour.Text) & "' AND [Check-in date] = '" & lstDate.SelectedItem.ToString & "' WHERE Reservation].ReservationID Is NULL AND Facility.[Facility Type] = '" & cboFacilityType.Text & "' I have this sql statement which …

Member Avatar for adam_k
0
1K
Member Avatar for preston326

Hello, Im currently studying for Database Administration Fundamentals exam. I have bought Microsoft's official book but its really poor. At the end of every topic there is a test but there are no answers to those questions. Therefore, could someone go through my test and check it. https://docs.google.com/file/d/0B503TtEQXNHiX1U1UWVFdEZETUE/edit?usp=sharing https://docs.google.com/file/d/0B503TtEQXNHiMjhwTnZ2MVllZHM/edit?usp=sharing Thank …

Member Avatar for RvSon
0
95
Member Avatar for AmrMohammed

Greetings I have the following question. I'm designing a new database for a human resource application. I will construct a table for employee information is it good to separate the employee information to 2 tables one for personal information and the other one for work data such as the salary, …

Member Avatar for IIM
0
104

The End.