Reading ClientProcessID
Sep 1, 2006Hi,
I need to know that how can we read ClientProcessID (älso use used in SQL Profiler).
Regards,
Shabber.
Hi,
I need to know that how can we read ClientProcessID (älso use used in SQL Profiler).
Regards,
Shabber.
hi guys, Can anyone advise me how how to read an excel doc i have stored locally? I need to be able to start the read from say row number 6 and finish the read once i get to a row that contains a pre-determined word signifying the end of processing. I intend to store the parsed data in an array that will be used as the data source for a gridview or repeater object on another asp page. I'm using ASP.net 2.0 and C# by the way. thanks in advance for any help!!!
View 12 Replies View RelatedWhy won't this dataReader read?
Dim objCon2 As New SqlConnection()
objCon2.ConnectionString = "a standard connection string"
objCon2.Open()
Dim objCommand As SqlCommand
objCommand = New SqlCommand(strSQL, objCon2)
Dim objReader As SqlDataReader
objReader = objCommand.ExecuteReader()
Label1.Text = objReader("email")
strSQL is a select command which I've checked (using SQL Query analyzer) does return data. I know the connection string is valid (and I presume if it wasn't that it'd fail on objCon2.open, which it doesn't).
So why oh why do I get this error on the last line (and yes, there is an "email" field in the contents of the reader)
System.InvalidOperationException: Invalid attempt to read when no data is present.
I have this code that I hacked together from someone else's example. I kind of understand how it works. I just don't know if it will and i am not in a location right now to check. I was wondering if I did this correctly first, second how can it improve and should i do something different. Basically i just want to check the password in a database. I am passing the username and password to this function from another functioprivate bool authUser(string UserName, string Password){ string connectionString = ConfigurationSettings.AppSettings["DBConnectionString"]; SqlConnection DBConnection = new SqlConnection(connectionString); bool result = false; DBConnection.open() SqlCommand checkCommand = new SqlCommand("SELECT password FROM Users WHERE userName='" + Password + "', DBConnection) SqlDataReader checkDataReader = checkCommand.ExecuteReader();
if(checkDataReader.GetString(0) == Password) { result = true; } else { result = false; } checkDataReader.Close(); DBConnection.Close();
return result;}Thank you Buddy Lindsey
Does anyone know how to read transaction log besides trace and profiler. The current situation is some one in our org. deleted an item and I'm trying to find out who and when.
View 2 Replies View RelatedI have some records that have been deleted. I need to find out who did it and to do that I need to read the logs. Are there any utilities that will allow me to read login 7.0? How about 6.5?
Chris
Here is I think an interesting question
is there a way to read or access the transaction log of a
database in SQL server 7.0
Hoping someone has a solution :-)
We are having continual problems with our transaction log filling up on one of our major applications.
Does anyone know of a way or tool to read the transaction log? We want to determine what is causing this problem.
Thanks
Is there a way, in SQL 7.0 to print out or view what's in the Transaction Log? In 6.5 you could view the table syslogs, but I don't see any documentation anywhere on how to do this in 7.0.
View 1 Replies View RelatedI receive in a table a field which is an xml string
like below
<NewOrder><SiteID>CJC</SiteID><patID>458887</patID><LName>Cronin</LName><FName>tim</FName><EntryID>{7B1A4946-CEC8-4F23-AE89-5C70A6A0F9B2}</NewOrder>
Is there a way read this field with a select statement? I need to strip out the entryid value in a trigger
I received a SQL Server 6.5 database (.dat file) on a removeable drive. I'm currently running 7.0. Is there any way to read/import/link to this data without installing 6.5. And if I have to install 6.5 how do I get the system to see the database?
View 1 Replies View RelatedHello people;
Somebody knows some utility where I can read the Transaction Log Sql 2000 ?
Thanks;
Navlig®
Hi
How can I read an ini file entry and pass this parameter to a stored procedure which will be run in a DTS Package?
Thanks for the input
mipo
Anyone know a way to read DTS packages? I have inherited a DTS package, saved in SQL, and am trying to find a way to read the steps without having to view every single step through the GUI.
Thanks in advance.
Hi. I want to write a function to retrieve all records from a "Parts" table so that I can read these records in .NET.
SqlDataReader reader = sqlCmd.ExecuteReader()
while( reader.Read() )
{
int x = reader["id"];
string partName = reader["name"];
// Do stuff with data here //
}
My question: How should the function be written?
Should I create a PROCEDURE and just call a SELECT statement?
CREATE PROCEDURE getPartsList()
AS
SELECT part_id as 'id', part_name as 'name' FROM parts
Or should I create a FUNCTION that returns a TABLE? If so, is this the correct syntax?
CREATE FUNCTION getPartsList()
RETURNS TABLE
AS
RETURN (SELECT part_id as 'id', part_name as 'name' FROM parts)
Thanks for reading
The requirement is to read XML element from database column.The column looks like
<ClMetadataDataContract xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cch.com/pfx.net/psi/">
<EntityType>1</EntityType>
<NameLine1>David Jones</NameLine1>
[code]....
I have also tries OPENXML but no luck
How do I view the SQL 2005 transaction log file(.ldf)?
Is there a built-in utility?
Thank you
I am storing one text file on the server.This text file contains some mobile numbers.The file look like
009198XXXXXXXX
009198XXXXXXXX
009198XXXXXXXX
009198XXXXXXXX
etc
Here I need to read this text file row by row mobile number and then insert these mobile numbers into a table by using sql procedure or sql trigger or any other method or coding. Is it is possible or not?
If so then anybody can help me!
regards
Shaji
Hello friends...
We have sql server 2000 and i need to read one perticular xml and from that i want ID field stored in one table...is it possible by query analyzer to read xml and stored ID in table...I have only path of that xml file...
like
select ID from ("D:XMLFolder*.xml)
that i want
-- drop proc SP_Trio_Popul_Stg_Tbls1
CREATE PROC [dbo].[SP_Trio_Popul_Stg_Tbls1] @tableName varchar(20) AS
-- alter PROC [dbo].[SP_Trio_Popul_Stg_Tbls1] @tableName varchar(20) AS
declare @sql varchar (20)
set @sql = 'INSERT INTO dbo.Name_Pharse_Stg_Tbl1 (nm_last)
SELECT nm_name FROM dbo.' + quotename(@tableName)
print @sql
exec (@sql)
----------------------------------------------------------------------
exec SP_Trio_Popul_Stg_Tbls1 '00485'
----------------------------------------------------------------------
INSERT INTO dbo.Name
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'Name'.
im trying to run this SP but im getting an error. Can you help me to fix it?
-------------------------
gongxia649
-------------------------
Hi All,
I would like to know if i can read data from xl sheet using a stored procedure?
Thanks in advance
vishu
Hi,
I've been a developer for 20 some years, but never learned the design steps of a complex database. Can you give me a book or 2 to bring me up to speed with the latest database design and data modeling techniques?
thanks.....
I do a lot of file processing and I usually run a little script I copyand paste to read directory information to see if a new file it thereand then process the file if it is. So, I decided to wise up and makea stored procedure to automate a lot of that.The pivotal step in this is that i run a command that looks like:CREATE TABLE #DIR (FileName varchar(100))DECLARE @Cmd varchar(1050)SET@Cmd = 'DIR "' + @Path + CASE WHEN RIGHT(@Path, 1) = '' THEN ''ELSE '' END + @WildCard + '"'INSERT INTO #DIREXEC master..xp_CmdShell @CmdWhen I run the stored procedure I get back the files and folders inthere that match the wildcard and all is good!!!!....Until I try to put that information into a table while calling thatstored procedure:CREATE TABLE #Files (Path varchar(100),FileName varchar(100),PathAndFileName varchar(150),FileDateTime SmallDateTime,FileLength int,FileType Varchar(10))INSERT INTO #FilesEXEC sp_GetFileNames @Path = '\isoft2ftpLegacyBilling', @Wildcard= '*.txt'When I run this I get:Server: Msg 8164, Level 16, State 1, Procedure sp_GetFileNames, Line53An INSERT EXEC statement cannot be nested.Because I use an INSERT EXEC to with the results from the @Cmd.Anybody have any ideas how I can get that information into a table?I did try to just copy the data to c: empdir.txt and then bulkimport it in. But when it runs the @Cmd to create the file it comesback with a NULL value and my stored procedure returns two sets ofvalues... which I can't do.So, I would appreciate anybody who can help.Thanks!-utah
View 4 Replies View RelatedHi,How can i read information in Transaction Log in SQL Server 2000?Thanks
View 1 Replies View RelatedI posted this in the Windows Forms Data Binding section, and they directed me to the .Net data section. I posted it there and waited a week with no replies. I'm hoping someone here can at least give me an idea of what the problem might be.
View 1 Replies View RelatedHi
I have a problem with SSIS in that I need to read an XML file in from a URL,which brings me back the below XML. What I need to be able to do is essentially create a single record, including the nested XML <image> into the same record. This information then needs to be entered into a database table.
What I found is that if I use a data flow component, and have an XML source pointing to this URL, it essentially creates a different output for every level of nesting. This causes me serious issues because I would then have to somehow get to the information in the <image> tag, and then get everything below that, etc, to be able to get the images related to each <stock> record. This is a pain.
I also looked at using an XML task, where I could use an XSLT to transform to the required output, however, I can't point this XML task to a URL to retrieve the XML.
If anyone has any ideas I would greatly appreciate it
Thanks
Darrell
XML Format
------------------
<feed date="2006-10-17 17:08:46">
<usedstock>
<stock id="SFU22991">
<make>Peugeot</make>
<model>206</model>
<description>Peugeot 206 1.4 X-Line, 5 door Hatchback Tiptronic Auto 4Spd</description>
<hotline>08451553610</hotline>
<spec>Air Conditioning, Power Steering, Central Locking, Electric Windows, Alloy Wheels, CD Player</spec>
<deepurl>http://www.regvardy.com/used_car/dseller/SFU22991</deepurl>
<search>http://www.regvardy.com/used_cars/dseller/Peugeot/206</search>
<regdate>2005-01-27</regdate>
<colour>Blue</colour>
<price>7495</price>
<stocktype>USED</stocktype>
<category>Small</category>
<transmission>Tiptronic Auto 4Spd</transmission>
<bodystyle>Hatchback</bodystyle>
<fueltype>Petrol</fueltype>
<type>NCV</type>
<doors>5</doors>
<engine>PE0BC</engine>
<capcode>PE2614SED5HPIA</capcode>
<capid>26440</capid>
<image>
<urls>
<url>http://www.regvardy.com/imagedata/vehicles/g/pj54lyg_1.jpg</url>
<url>http://www.regvardy.com/imagedata/vehicles/g/pj54lyg_2.jpg</url>
<url>http://www.regvardy.com/imagedata/vehicles/g/pj54lyg_3.jpg</url>
</urls>
<libraryimage/>
</image>
</stock>
</usedstock>
</feed>
Hi,
For our trainign data clustering models show the maximum accuracy.
We want to preset the results to our client. In order to do that we want to present what are the properties of each cluster.
For example for my predictable attribute if Cluster 9 is showing maximum population then I want to show what conditions of attributes make cluster 9 .
What is the way of doing this ?
Thanks,
Vkas
I am trying to read from a datasource that is a CSV file using C#, but for some reason I keep getting an error that says:
System.Exception: System.Data.OleDb.OleDbException: Syntax error in FROM clause.
My code looks like this:
String sql = " SELECT IDnumber FROM report.csv WHERE username = @Username ";
ArrayList parameters = new ArrayList();
parameters.Add(new OleDbParameter("@Username", Username));
DataTable dt = OleDbUtility.getDataTable(sql, parameters, OleDbUtility.GetCNetIDConnectionString());
It worked with an Excel file, so any ideas on this one?
It seems like the connection string is fine...
Hi
I was searching some books about SQL but all that i found was "Big books", i mean, i found books about all SQL Server and i just need to know a few things.
I'll need to make queries to a DB and make excel or acces reports based on the query result.
Well, thanks in advance
Hello,
I am trying to figure out how to properly read a single message(poll) at a time from ADO .Net in c# 2005.
I am assuming i need to write a sproc that does a receive, but I wanted to validate if there were already any examples of this already?
I have been reading quite alot but don't see this exactly as an example anywhere and it is probably easier then my brain is allowing it to be.
If you have an example or would help me i would appreciate it. I am "hoping" for more then just "write a sproc and call it" as I believe this is accurate but am hoping for more info.
Happy to read, happy to research, but I am atm, lost for where to go next. I am going to start doing some plain testing, but appreciate any help.
Thanks,
-Mike
Brand new to SSIS so bear with me, if something is obvious.
I want to be able to read a file from a certain directory. But the file name changes every day. So today its File20061203 tomorrow File20061304 or the next day it could be FileNB4434. The format in the file will always be the same though. I just want for a user to be able to drop a file in a directory and the package pick it up once a day.
Would I have to to create a script task or could I use a variable. I have been trying to use the variable but have not been able to get them to work. This calls for only looking for 1 text file in a folder but any additional links that show some good variable examples would be appreciated. One where only part of the variable changes File(Variable)Division.txt
Thanks in advance
hi,
how do i do in ssis if i want to read the textfile row by row? i need to do this since every line in my flat file has different conditions to fulfill depending on the content of the row.
cherriesh
I am trying read certain attribute from a XML Source based on a particular attribute.
My XML source has the following Structure:<Database ID = "1" Source = "ABC" ></Database><Database ID = "2" Source = "ABC" ></Database><Database ID = "3" Source = "DEF" ></Database>.
I would like to fetch the list of IDs filtering upon Source = "ABC". (which should idealy give me 1,2)
I tried using the For Each Nodelist Enumerator By specifying the Enumeration type as Node and IDrect Input for the OuterXpathString as DATABASE[@Source="ABC"].
The for each loop fails giving the following error. Data is invalid. line 1 position 1.
Can anyone help me out with the same. Is there any other way around to obtain the required result?
Pranathi