Display Duplicates Entry From Sql Server

Jul 11, 2006

Hello,

I like to ask if anyone knows the sql statement to display all the field of a record from a table only showing the duplicates, and my criteria of duplicate is that a record has two fields with the same data. Thanks in advance.

Regards,

stealthnet

View 2 Replies


ADVERTISEMENT

Power Pivot :: Create Measure Within Date Dimension Table To Sum Single Entry Per Month Eliminating Duplicates

Jul 27, 2015

We are trying to do some utilization calculations that need to factor in a given number of holiday hours per month.

I have a date dimension table (dimdate).  Has a row for every day of every year (2006-2015)

I have a work entry fact table (timedetail).  Has a row for every work entry.  Each row has a worked date, and this column has a relationship to dimdate.

Our holidays fluctuate, and we offer floating holidays that our staff get to pick.  So we cannot hard code which individual dates in dimdate as holidays.  So what we have done is added a column to our dimdate table called HolidayHoursPerMonth. 

This column will list the number of holiday hours available in the given month that the individual date happens to fall within, thus there are a lot of duplicates.  Below is a brief example of dimdate.  In the example below, there are 0 holiday hours for the month of June, and their are 8 holiday hours for the month of July.

DateKey MonthNumber HolidayHoursPerMonth
6/29/2015 6 0
6/30/2015 6 0
7/1/2015 7 8
7/2/2015 7 8

I have a pivot table create based of the fact table.  I then have various date slicers from the dimension table (i.e. year, month).  If I simply drag this column into the pivot table and summarize by MAX it works when you are sliced on a single month, but breaks if anything but a single month is sliced on.  

I am trying to create a measure that calculates the amount of holiday hours based on the what's sliced, but only using a single value for each month.  For example July should just be 8, not  8 x #of days in the month. 

Listed below is how many hours per month.  So if you were to slice on an entire year, the measure should equal 64.  If you sliced on Jan, Feb and March, the measure should equal 12.  If you were to slice nothing, thus including all 15 years in our dimdate table, the measure should equal 640 (10 years x 64 hours per year).

MonthNumberOfYear HolidayHoursPerMonth
1 8
2 4
3 0
4 0
5 8
6 0
7 8
8 0
9 8
10 4
11 16
12 8

View 3 Replies View Related

How To Avoid Display Of Duplicates

Jul 8, 2000

Hi,
I'd really appreciate advice on now to avoid displaying duplicates in a resultset like the one below, only displaying the first field once and all the rows that correspond to that field all listed listed below. Distinct doesn't work. Thanks
Customer Name Address
============= =======

Big Bob's Books 123 Stone Lane
456 Seaside Drive
789 Waterhouse Square
1234 Mystery Drive
5678 Simple St

Tiny Tim's Tools

Tiny Tim's Tools

View 1 Replies View Related

Display Duplicates Which Have A Different State

Jan 29, 2012

I have this query here which displays all duplicates which have the same phone number but i am trying to modify it to display only fields that have the same phone number but have different state

SELECT *
FROM businesses t1
join (SELECT ce_phone FROM businesses GROUP BY ce_phone HAVING COUNT(*)>1) t2
ON t1.ce_phone = t2.ce_phone
WHERE t1.ce_phone is not null
ORDER BY t1.ce_phone

So what I would try to do would be to group state within the ce_phone group and count the state duplicates and if it is less than the count of phone then i would display it but i am just not sure how to write the syntax for it.

View 2 Replies View Related

Display All Rows (including Duplicates) In Report

May 8, 2007

I have a report that is built using the report builder and the report model that was created.
With the fields that are displayed in the report, it could be possible for the database to have multiple rows with the same values for all the fields (that are displayed in the report). The PK will be different, but this is not displayed in the report as the PK won't make sense in the report.
So what happens is that the report displays just 1 record even though the database has multiple records because all the fields (that are displayed in the report) are identical. Is there a way to make the report display all the rows irrespective of duplicates?

View 1 Replies View Related

T-SQL (SS2K8) :: Rank Duplicates But Only Rows Involved In Duplicates?

Oct 22, 2014

I have a table with 22 million Business records. I can see that there are duplicates when I group by BusinessName and Address and Phone. I'd like to place only the duplicates into a table, with a ranking, oldest business key gets a ranking of 1.

As a bonus I'd like each group to have a distinct group name (although not necessary, just want to know how to do this)

Later after I run more verifications to make sure these are not referenced elsewhere I'll delete everything with a matchRank > 1 out of the main Business table.

DROP TABLE [dbo].[TestBusiness];
GO
CREATE TABLE [dbo].[TestBusiness](
[Business_pk] INT IDENTITY(1,1) NOT NULL,
[BusinessName] VARCHAR (200) NOT NULL,
[Address] VARCHAR(MAX) NOT NULL,

[code]....

View 9 Replies View Related

Converting Duplicates Records Into Non Duplicates?

Jan 26, 2015

Is there a query or a way to convert duplicates value in a column to non duplicates.

View 14 Replies View Related

Easy Data Entry In SQL Server

Jan 22, 2006

Hi all,

I have been using SQL Server 2K for a couple of months now and I have been entering data into my tables through Enterprise Manager. I do this by selecting the table, right-clicking on it, and selecting Return All Rows.

After months of use, this method of entering data has become tedious and cumbersome. Is there an easier way to enter data into SQL Server? I don't know how to program Visual Basic, but I know how to create dynamic websites.

Microsoft Access offers the ability to make Forms, so that data entry is easier. Can SQL Server offer anything similar? Maybe SQL Server 2005 offers a GUI for data entry?

Cheers for your help!

View 11 Replies View Related

Entry Point Not Found With MS SQL Server

Jul 20, 2005

Hi All!Has anyone has seen this error before?Event Type:InformationEvent Source:Application PopupEvent Category:NoneEvent ID:26Date:5/14/2004Time:10:06:45 AMUser:N/ADescription:Application popup: sqlmangr.exe - Entry Point Not Found : Theprocedure entry point TraceMessage could not be located in the dynamiclink library ADVAPI32.dll.This computer is running MS SQL Server STD Edition 2000 W/ ServicePack 1.Thanks!

View 1 Replies View Related

SQL Server 2012 :: Query For Single Entry Record Only?

May 26, 2015

I have records like below, single query to get result below, basically records that has single entry only, which has type '0'

table : temp_test
idtype
c10
c25
c30
c40
c47
c59
c64
c60
c77
c80
c90

Result out of query

idtype
c10
c30
c80
c90

View 4 Replies View Related

Sql Server 2005 Named Instance Dsn Entry Using A .bat File

Mar 6, 2007

Several applications in out environment use Microsoft access to access the SQL server databases. Our new SQL Server 2005 instance is a named instance. We would like to create a .reg file to update the individual workstations as part of the migration. For some reason the .reg file with a named instance does not work. If the entry is created through the GUI it works. The server drop down does not show the named instance, only the server name but if you type the servernameamed_instance it finds it ok. Here is an example of what works and what does not. Any ideas on what the problem might be?

Windows Registry Editor Version 5.00 - Does NOT work

[HKEY_LOCAL_MACHINESOFTWAREODBCODBC.INIADOITTars]
"Driver"="C:\WINDOWS\System32\SQLSRV32.dll"
"Description"="ADOITTars"
"Server"="NRSQL3NRSQL3"
"Database"="ADOITTars"
"LastUser"=""
"Trusted_Connection"="Yes"

[HKEY_LOCAL_MACHINESOFTWAREODBCODBC.INIODBC Data Sources]

"ADOITTars"="SQL Server"

Windows Registry Editor Version 5.00 - works

[HKEY_LOCAL_MACHINESOFTWAREODBCODBC.INIADOITTars]
"Driver"="C:\WINDOWS\System32\SQLSRV32.dll"
"Description"="ADOITTars"
"Server"="NRSQL2"
"Database"="ADOITTars"
"LastUser"=""
"Trusted_Connection"="Yes"

[HKEY_LOCAL_MACHINESOFTWAREODBCODBC.INIODBC Data Sources]

"ADOITTars"="SQL Server"

View 5 Replies View Related

SQL Server Admin 2014 :: Unattended Upgrade Fails On Missing Registry Entry?

Jun 23, 2015

I'm trying to do an unattended upgrade of 2014 RTM to 2014 SP1.

It's my first attempt at an upgrade configuration file, and its failing with missing registry entry for database engine service and replication service.

Error in summary.txt is:

The registry key SOFTWAREMicrosoftMicrosoft SQL ServerMSSQL12.MSSQLSERVER2495Setup is missing

That's a valid error, as the registry only has an entry for:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL ServerMSSQL12.MSSQLSERVERSetup

Am I missing something obvious here, or how can this be resolved?

View 9 Replies View Related

Extracting Duplicates From SQL Server 2000

Dec 28, 2007

Hey Guys,Total Number of Records (Based on 5 fields): 1000Total Unique Records (Based on 5 Fields): 990Total number of fields: 5I have question regarding extracting duplicates from the dataset. Ihave 2 fields that makes a record unique. I have used group byfunction to find duplicates and got 10 records that are duplicating.Each records duplicating 1 times, thus, 10 unique records and 10duplicates, giving me 990 unique records out of 1000.Now, I want to filter out duplicates from the dataset and get uniquerecords, including all 5 fields. Here is the query that I used.select *from (select field1, field2, count(*)from table 1group by field 1, field2having count(*) >1)a,table 1 bwhere a.field1=b.field1 and a.field2=b.field2When I use this query, it gives me duplicate records as i am matchingon both fields that makes records unique. Is there anyway to justextract unique records?Thank you very much for your help.--AP

View 4 Replies View Related

MSSQL Dbo Table Duplicates On Host Server

Apr 26, 2005

(i am not sure which forum to post this too)
Hi, I imported a table onto my host's server, table_Login which has username password, and userID. userID is Primary Key & identity.
When I had my code do insert of new user, I was getting error the Login.userID doesn't allow null values. Which shouldn't have mattered because userID is an identity.
After making a diagram from Enterprise Manager, I noticed that I have two Login tables (although only one shows in Enterprise Manager's "Table" node view. The second table, which had none of the constraints that my table of the same name which is listed under the "Table" node does; appears to be the table which is being written to by my code.
I can't find this table, Login(dbo), through Enterprise Manager, nor am i sure how to access it through Query Analyzer. Needless to say, I don't like this arrangement. and well tech support for this host seems to leave a lot to be desired.
Anyone know what needs to be done so that I can fix it or fight with tech support to convince them that they should?

View 2 Replies View Related

SQL Server 2014 :: Update Duplicates In A Column

Aug 13, 2015

How do I append an accumulating number to duplicates in a column? I would prefer to update the table

for example

Name
John
John
Tom
Bob
Bob
Bob
Mike

to look like

Name
John
John1
Tom
Bob
Bob1
Bob2
Mike

View 1 Replies View Related

SQL Server 2008 :: Remove Duplicates From Query?

Oct 6, 2015

I am working with a bunch of records that have duplicates on the Persid and the intPercentID where there are duplicates I want to remove when I stick them in the temp table, I tried join on tempo table and doing not exists but still inserts, so now I am trying a merge but same thing. how can I keep duplicates from being inserted in the temp table. I made a cursor as well but its slow as heck, but it does work. trying better ways.

Create table #TempStr (STRId int not null Identity(1,1) primary key, Persid int, percentId int, dtCreated datetime, CreatedBy int)

Create table #NewStr (STRId int, Persid int, percentId int, dtCreated datetime, CreatedBy int)

INSERT #TempStr (Persid, percentId, dtCreated, CreatedBy)
select intPersonnelID, intPercentID, dtSubmitted, intSubmittedBy from tblSTR
whereintpercentId in (61,62) group by intPercentID, intPersonnelID, dtSubmitted, intSubmittedBy
UNION ALL

[code]....

View 3 Replies View Related

SQL Server 2012 :: Filter Duplicates Based On String?

Feb 19, 2014

CREATE TABLE #Names
( ID INT IDENTITY(1,1),
NAME VARCHAR(100)
)
INSERT INTO #Names VALUES ('S-SQLXX')
INSERT INTO #Names VALUES ('S-SQLXX.NA.SN.ORG')
INSERT INTO #Names VALUES ('S-SQLYY')
INSERT INTO #Names VALUES ('S-SQLYY.NA.SN.ORG')
INSERT INTO #Names VALUES ('S-SQLCL-HR')
INSERT INTO #Names VALUES ('S-SQLCL-MIS')
SELECT * FROM #Names

--I want to filter out S-SQLXX.NA.SN.ORG because S-SQLXX.NA.SN.ORG is a duplicate of S-SQLXX eliminating .NA.SN.ORG from it.

--I want to filter out S-SQLYY.NA.SN.ORG because S-SQLYY.NA.SN.ORG is a duplicate of S-SQLYY eliminating .NA.SN.ORG from it.

--However I want to keep S-SQLCL-HR and S-SQLCL-MIS in my list of names as they do not have .NA.SN.ORG as a part of their name

--I want ONLY these returned IN the SELECT

SELECT * FROM #Names WHERE ID IN (1,3,5,6)
DROP TABLE #Names

View 1 Replies View Related

SQL Server 2014 :: Remove Duplicates In Opposite Columns

Jan 22, 2015

I have a table containing the following data:

LinkingIDID1 ID2
166202180659253178
166202253178180659
166334180380253179
166334253179180380
166342180380180659
166342180659180380
166582253179258643
166582258643253179
264052258642258643
264052258643258642
264502258643258663
264502258643259562

Within the LinkingID, there are duplicates in ID1 and ID2 but just in opposite columns. I have been trying to figure out a way to remove these set based. It doesn't matter which duplicate is removed. Essentially these are just endpoints and I don't care which side they are on. The solution must recognize the duplicates and not just remove based on every 2nd row.

View 8 Replies View Related

SQL Server 2008 :: Table Returning Duplicates When Joined On

Jul 7, 2015

We currently have an application whereby the user will come along sign up add some information about them, choose what interests / hobbies they're in to and then click save.After completing the sigh up they're able to search for other individuals within locations (look at this functionality as a dating site) We currently have a stored procedure whereby when the user clicks Advance Search they fill in all the fields they filled in when signing up and when they click search we return all users that match the data the user has selected. This part is working correctly.

The issue im having is extending this stored procedure to take a user defined table type which has two columns UserId and ActivityId both columns are nullable.This user defined table type is referred to in two places, when the user signs up and when they do an advance search.When the user does an advance search he / she can choose a list of hobbies / interests this will then be passed in to the database and I will join on my User_Activities table to find the users that have the Activities passed in.When I join on this table I get duplicate records purely because one user may have 5 - 10 activities depending on how active the individual is. My current stored procedure looks like this

@Ambition int = null,
@Body int = null,
@Diet int = null,
@Drinking int = null,
@Ethnicity int = null,
@Exercise int = null,
@HeightFrom int = null,

[code]...

So my question is how can I select all users that match the criteria passed in, as well as finding the users that match the activities passed in (the user can either match all of them or a minimum of 1). Also my User_Activities has two columns UserId and ActivityId identical to the user defined table type

View 9 Replies View Related

SQL Server 2008 :: How To Find Duplicates In A Table As Per Particular Column

Nov 2, 2015

I am having a main table and temptable.

Every sunday, new data will be loaded from temptable to main table. I have to make sure that, duplicates does not get loaded from temptable to maintable.

For example, if last sunday a record gets loaded from temp to main. If this sunday also the same record is present then it means that is a duplicate.

The duplicate is decided on below scenario

select 'CodeChanges: ', count(*) from CodeChanges a, CodeChanges_Temp b
where a.AccountNumber = b.AccountNumber and
a.HexaNumber = b.HexaNumber and
a.HexaEffDate = b.HexaEffDate and
a.HexaId = b.HexaId and

[Code] ...

Yesterday (Sunday) , data from temp got loaded onto maintable but with duplicates.

There is a log which just displays number of duplicates.

Yesterday the log displayed 8 duplicates found. I need to find out the 8 duplicates which got loaded yesterday and delete it off from main table.

There is a column in both tables which is 'creation date and time'. Every Sunday when the load happens this column will have that day's date .

Now i need to find out what are all the duplicates which got loaded on this sunday.

The total rows in temp table is : 363
No of duplicates present is : 8

I used below query to find out the duplicates but it is returning all the 363 rows from the maintable instead of the 8 duplicates.

Select 'CodeChanges: ', * from CodeChanges a where
exists
( Select 1 from CodeChanges_Temp b where
a.HexaNumber = b.HexaNumber and
a.HexaEffDate = b.HexaEffDate and

[Code] ...

Need finding the duplicate records which has creation date time as '2015-11-01 00:00:00.000' and all the above columns mentioned in the query matches.

Example

Few colums only metioned below

creationdateandtime HexaNumber HexaCode
1. 1987-10-01 00:00:00.000 5 3
2. 2015-11-01 00:00:00.000 5 3

So here the second record is duplicate. This is what I am trying to find.

View 4 Replies View Related

SQL Server 2008 :: Query Joining Multiple Tables Getting Duplicates?

May 17, 2013

I'm joining several tables and when I add the last one I get duplicate results. How can I get just one for each?

select a.field, b.field, c.field
from atblname as a inner join btblname as b on a.id = b.parent_id
left outer join ctblname as c on a.id = c.parent_id

There are more than one result when joining tbl a and c, but I'm getting a reult for each of them for all results from joining a and b.

View 9 Replies View Related

Reporting Services :: Display Columns When There Is No Data To Display

Apr 30, 2015

I would like to display a portion of report where there is data or no data

There is data subreport  display   

     Product Name Latex Gloves  
     Product ID      
xxxx5678

 There NO data in the subReport
 
  Product Name                          
   Product ID    

View 3 Replies View Related

SQL Server 2012 :: Finding Duplicates And Show Original / Duplicate Record

Nov 3, 2014

There are many duplicate records on my data table because users constantly register under two accounts. I have a query that identify the records that have a duplicate, but it only shows one of the two records, and I need to show the two records so that I can reconcile the differences.The query is taken from a post on stack overflow. It gives me 196, but I need to see the 392 records.

How to identify the duplicates and show the tow records without having to hard code any values, so I can use the query in a report, and anytime there are new duplicates, the report shows them.

SELECT
[groom_first_name]
,[groom_last_name]
,[bride_first_name]
,[bride_last_name]

[code]....

View 5 Replies View Related

SQL Server 2008 :: Merge Statement When Source Table Supplies Duplicates

Apr 26, 2015

With merge/insert statements ...Is DISTINCT best way to handle problem of source table containing duplicate rows, along with WHERE NOT IN statement? the source dataset is large and having to do DISTINCT and further filtering is taxing on the ETL.

DDL
source table
CREATE TABLE [dbo].[source](
[Product_ID] [INT] NOT NULL,
[ProductCode] [VARCHAR](20) NULL,
[ProductName] [VARCHAR](100) NULL,
[ProductColor] [VARCHAR](20) NULL,

[code]....

View 0 Replies View Related

SQL Server 2014 :: Duplicates Of Part-number To Be Summed And Add Another Column Called User?

Aug 25, 2015

There are 3 columns in the result set - part num, Qty and MO num. Each MO num has part numbers.So there might be same part numbers in MO's. Each part num has qty. So, if I group by part num, I get Qty.

1.There are duplicates of part.num and I want to remove duplicates and add quantities of those duplicates into one single quantity. For example, xxxx is a part num, then xxxx=1,xxxx=3,xxxx=5. I want xxxx=9. I want to sum those. Another question is, each MO has a user. I want to join user and MO num in MO.

Heres the code,

part.num , (woitem.qtytarget/wo.qtytarget) AS woitemqty,
(SELECT LIST(wo.num, ',') FROM wo INNER JOIN moitem ON wo.moitemid = moitem.id WHERE moitem.moid = mo.id) AS wonums FROM mo INNER JOIN moitem ON mo.id = moitem.moid
LEFT JOIN wo ON moitem.id = wo.moitemid
LEFT JOIN woitem ON wo.id = woitem.woid AND woitem.typeid = 10 LEFT JOIN (Select sum(woitem.qtytarget) as labor, woitem.woid, uom.code as uom from woitem JOIN part on woitem.partid = part.id and part.typeid = 21 JOIN uom on woitem.uomid = uom.id group by 2,3) as labor on wo.id = labor.woid LEFT JOIN part ON woitem.partid = part.id

View 1 Replies View Related

Could Not Add The Entry...

Nov 22, 2005

Can someone please help me solve the following error? I am not sure of the version my hosting company is using and where to get the manual.
Could not add the entry because: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-id, title, entry, date_entered) VALUES ('testing', 'testing', . The query was INSERT INTO blog_entries (blog-id, title, entry, date_entered) VALUES ('testing', 'testing', 'testing'.


PHP Code:




if ($dbh = mysql_connect ('localhost', 'blu6592_money', 'rich')) {
    print '<p>Successfully connected to MySQL.</p>';

if (mysql_select_db ('blu6592_myblog')) {
    print '<p>The database has been selected.</p>';
} else {
    die ('<p>Could not select the database because: <b>' . mysql_error() . '</b></p>');
}

$query = "INSERT INTO blog_entries
(blog-id, title, entry, date_entered)
VALUES (0, '{$_POST['title']}',
'{$_POST['title']}',
'{$_POST['entry']}', NOW())";

if (mysql_query ($query)) {
    print '<p>The blog entry has been added.</p>';
} else {
    print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>";
}

} else {
    die ('<p>Could not connect to MySQL because: <b>' . mysql_error() . '</b></p>');
}

mysql_close(); 






Thanks in advance.

View 1 Replies View Related

Last Entry In A Log

Aug 13, 2005

(I don't post here often, so in case I'm violating long-standing taboosof this newsgroup, I apologize in advance for calling a relation atable, using nulls, and other ignorant, destructive, and comtemptibleterminology.)I have a table that's keeping a sort of running log of different typesof changes to pieces of data. The table has a foreign key of the databeing changed, the foreign key for the type of change occuring, someinformation about the change in a couple more columns, and a timestampfor each entry. So it's:dataIDeventIDeventInfotimestampWhat I'd like to do, if at all possible, is a single SQL query that,given a dataID, returns the most recent eventInfo and timestamp foreach eventID. Is this possible?Many thanks.-Eric

View 3 Replies View Related

Unable To Display PDF Stored In SQL Server

Apr 21, 2004

I have fixed all problems from my last post except the ability to download and view the pdf stored in the sql database via web browser. I have read all posts on this site, but no one seems to have any idea how to make it work. I can have become a download for saving and viewing, but I want to be able to have it appear in the browser without downloading.

here is the code.


if(r.Read())
{
Response.Clear();
Response.ClearHeaders();
//Response.BufferOutput = true;
Response.BufferOutput = false;

//Response.ContentType = r["Type"].ToString();
Response.ContentType = "application/pdf";

//This provides just a blank browswer
Response.AddHeader("Content-Disposition", "inline;filename=me.pdf");

//this will allow download and save to disk
//Response.AddHeader("Content-Disposition", "attachment;filename=me.pdf");

Response.BinaryWrite((byte[])r["ImgField"]);

Response.Flush();

Response.End();
}

View 2 Replies View Related

SQL Server 2008 :: Display One Row For The Query?

Jan 29, 2015

For the following query, I am trying to fetch only one row (no duplicates) for each BL_ID based on the logic that if I have multiple rows for one BL_ID, then only the one which has the largest LEG_SEQ_NBR should be displayed and the other rows should be ignored.

I am using the below code get to the above logic:

ROW_NUMBER() OVER (PARTITION BY ITIN.BL_ID ORDER BY ITIN.LEG_SEQ_NBR desc) AS RowNum

select
*
FROM
(
SELECT
TMIS.[BL_ID]
,[POL_NAME]
,[POD_NAME]

[code]....

where rownum in (1,2)

View 6 Replies View Related

Display All The Fields In Sql Server 2005

Nov 15, 2007

I want to select all the fields from just one table
This is what i have and i am having trouble selecting all the fields
select * from ace_users
where chdata EXISTS
(select chdata, count(chserialnum)
from ace_users
group by chdata
having count(chserialnum)> 1)

Exists and IN does not work.

View 3 Replies View Related

Parameter Display Box In Report Server

Nov 28, 2007

When I open a report in Report Server it opens up with the parameter area open, showing available paramater lists.

However when I call the same report from another report the parameter area is closed. I would like the default behavior to be the same - an open parameter display area.

Is this possible?

Thanks.

View 6 Replies View Related

How To Retrieve And Display Data From SQL-server?

Feb 15, 2008

Hello,

I need to retrieve data from a SQL-server table using a stored procedure. I want to retrieve the values from the table and add them to labels on a form. What is the easiest way to do this? Is dataset the solution?

I appreciate any help!


string sCN = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

SqlConnection sqlConnection2 = new SqlConnection(sCN);





SqlCommand cmd = new SqlCommand();

cmd.CommandType = System.Data.CommandType.Text;

cmd.Parameters.AddWithValue("@userID", userID);



Int32 rowsAffected;

cmd.CommandText = "get_user"; //Stored procedure to get user data. Takes UserID as parameter

cmd.CommandType = CommandType.StoredProcedure;

cmd.Connection = sqlConnection2;



sqlConnection2.Open();

rowsAffected = cmd.ExecuteNonQuery();

sqlConnection2.Close();

View 20 Replies View Related

Advice On Entry In To IT

Apr 12, 2004

Anyone Got any other advice?

http://www.dbforums.com/t993214.html

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved