|
What happens if you just say
SELECT * FROM sde.Property WHERE (FUNC_KEY = 'PV000000')
how many records do you see?
|
|
|
|
|
i see Records with Dublicates in Property_ID.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Vuyiswamb wrote:
i see Records with Dublicates in Property_ID.
Then it looks like Property_ID is not the primary key of this table.
|
|
|
|
|
Either you must be referring to a Foreign Key Column for which Unique-Key Constraint is not set or You must be doing a Multi-Table Select . There is no chance of Identiy Primary key Column to generate Duplicate value.
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
before deleting the record by below query
say
"delete from table1
where id='20'"
write set rowcount 1
it will delete only one if u had two identical row.
else if u have bulk records to be deleted
create temptable copy all distinct records to tahat table
truncate ur original table and copy the data from temptable ot original table
ex
step 1
create table #temptable
insert into #temptable
select distinct * from original table
step 2
truncate table original table
step 3
insert into #temptable
select * from #temptable x
hope it will work
Regards,
Suyash
|
|
|
|
|
hi. I want to export data from sqlserver to excel . but I want to do this with sql query , not enterprise manager.
is there any query to do this?
thanks.
|
|
|
|
|
Have a look at this article[^].
Paul Marfleet
|
|
|
|
|
i want to fetch the database schema(either MSACCESS OR SQLSERVER 2005).
language c#.
chanzeb chaudhary
|
|
|
|
|
You can get schema data from a DataAdapter object. For an Access DB, you can use System.Data.OleDb.OleDbDataAdapter. For SQL, System.Data.SqlClient.SqlDataAdapter. You use this object in conjunction with a connection object, a command object, and either a datatable or dataset. You can get the schema by using the .FillSchema function. Like this:
daMyDataAdapter.FillSchema(dsMyDataSet, SchemaType.Mapped)
You can search for more information in the articles and they can probably explain it better. Another way to get the schema is to setup a regular select statement but add 1=2 to the WHERE clause. Since 1 will never equal 2, it will bring back an empty dataset.
Hope this helps.
|
|
|
|
|
|
Hi.
In SQL Server 2005, when I attach a DB that is made in another computer, the primary key and Identity and diagram will be removed.
Oh! the diagram section don't open at all, so that I after attach must create another DB and imports tables in it, and then set primary key, Identity and make diagram!
Why?
Best wishes
|
|
|
|
|
I've just checked this.
Nothing like this happens. Do you save the changes in the diagram and tables after you make them?
|
|
|
|
|
Hi,
Is it possible to databind user.identity.name to formview text box that so user name is included when using insert New command. I want to include user name in sql table using formview without user having to input name?
Any help or appropriate link would be much appreciated.
Thanks
Steve
|
|
|
|
|
If you want to use the User.Identity.Name then you need to either use Windows authentication or Forms Authentication. This really isn't the forum for this, but this[^] or this[^] article might help you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I fixed an after update trigger with a table in Sql server 2005 and i want to get the last Identity updated in the this table to inserted in another table. How can i get the last updated Identity in a table?
Please help
Thank you
Sms
|
|
|
|
|
Do you mean that you have an Identity column in your table and, following an update, you want to find out he value in this field for the records that were updated? If so, you should look at the values in this field for the rows in the inserted entity in your trigger implementation.
Paul Marfleet
|
|
|
|
|
If you need the identity of the inserted record in the main table, use the scope_identity() function to retrieve the data.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I would appreciate some info regarding how to connect to the currently open database using the CurrentDb connection string. I am not certain of the syntax. Here is what I have so far:
Dim dbsHeadcount As Database
Dim Cnxn As ADODB.Connection
Dim strConn As String
Dim rstInputFile As ADODB.Recordset
Dim cmdSQLInputFile As ADODB.Command
Dim strSQLInputFile As String
Dim rstHyperionMany As ADODB.Recordset
Dim cmdSQLHyperionMany As ADODB.Command
Dim strSQLHyperionMany As String
Dim rstHyperionOne As ADODB.Recordset
Dim cmdSQLHyperionOne As ADODB.Command
Dim strSQLHyperionOne As String
Dim strDBPath As String
Dim strFileName As String
Dim strMessage As String
Set dbsHeadcount = CurrentDb
Set cmdSQLInputFile = New ADODB.Command
Set cmdSQLInputFile.ActiveConnection = CurrentDb.Connection ' IS THIS RIGHT??? IF NOT WHAT IS THE SYNTAX??? :confused::confused::confused:
strSQLInputFile = "SELECT [COUNTRY], [TYPE], [BUSINESS UNIT], " & _
"[L/R/G], [REGION], [JOB FUNCTION], [09/12/2007 Reported] " & _
"[NUMINDEX] FROM [TBLINPUTFILE]"
cmdSQLInputFile.CommandType = adCmdText
cmdSQLInputFile.CommandText = strSQLInputFile
Set rstInputFile = cmdSQLInputFile.Execute()
rstInputFile.MoveFirst
Set cmdSQLHyperionMany = New ADODB.Command
Set cmdSQLHyperionMany.ActiveConnection = CurrentDb.Connection
strSQLHyperionMany = "SELECT [COUNTRY], [TYPE], [BUSINESS UNIT], " & _
"[L/R/G], [REGION], [JOB FUNCTION], [09/12/2007 Reported] " & _
"FROM [tblInputFile]"
cmdSQLHyperionMany.CommandType = adCmdText
cmdSQLHyperionMany.CommandText = strSQLHyperionMany
Set rstHyperionMany = cmdSQLHyperionMany.Execute()
rstHyperionMany.MoveFirst
The problem is how do I connect to the CurrentDb.Connection that is currently active?
|
|
|
|
|
In what context??? In this VBA code in Access?? It looks like it, but we have to be sure.
I think you might be looking for something closer to this:
Dim conn As ADODB.Connection
Dim comm As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim param As ADODB.Parameter
Set conn = Application.CurrentProject.Connection
comm.ActiveConnection = conn
...
|
|
|
|
|
|
By running the sp’s through DTS
the data is collected in a form of excel data file
Now I want the solution so that folder which contains the excel file
Will get copy automatically on the server.
At present we are manuualy copy that folder using FTP
|
|
|
|
|
And this has what to do with SQL or databases??
|
|
|
|
|
DTS has a "File Transfer Protocol Task" (that I think can read a single file at a time) and an "Execute Process Task" (that could be used to run "ftp.exe" with a script file).
For my project, we obtained an FTP ActiveX component and wrote an ActiveX Script task.
|
|
|
|
|
Hi,
I need to solve this asap and Im new to the development world. So someone pls help me on this.
I have a table user_det with fields userid,fname,lname,add. If I need a system generated id, I can use a GUID. But if I need a auto increment id which is defined by me, say User001..then User002..etc, how can I achieve this?
Please let me know asap..Its reallly urgent.
Thanks.
Regards,
Anuradha
|
|
|
|
|
anuradha.rrao wrote: Its reallly urgent.
That is not a polite thing to say around here.
anuradha.rrao wrote: say User001..then User002..etc,
You might be best off having a field called user and the values in the field be integers. Then, from there, you would have the field be an identity field with auto-increment set to how you want to increment the integer. Google Identity for MSSQL for more info.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|