|
Right, I use a bunch of different databases, rarely the latest and greatest.
|
|
|
|
|
Is there an SQL Formatter based on Celko's SQL PROGRAMMING STYLE? Someone has probably written something that can follow my rules, but I have not seen it yet.
|
|
|
|
|
--CELKO-- wrote: Celko's SQL PROGRAMMING STYLE
Got a link?
|
|
|
|
|
It is a book; try Amazon.com or whoever you like.
|
|
|
|
|
Hi,
My database is sql server 2005
I have a city table.
Which contains 300 records.
i am inserting those records in temporary table. using the following code
In first window i wrote following code.
Select * Into #TCity FRom Cp_City
select * from #TCity
select * from sys.objects where name = '#TCity'
In second window i wrote following code,
Select * Into #TCity FRom Cp_City
select * from #TCity
select * from sys.objects where name = '#TCity'
My question how can i create a temporary table with a same name in two different windows.
Thanks
|
|
|
|
|
I believe you would need to create 2 different connections to the database. I believe the temp tables are unique to the session ID that is created when a connection is made.
Q: When you say "In first window ...", do you mean window in the Sql Server Management Studio ? If yes, then it might become a bit tricky to make multiple connections to the same server using the same username.
You could start a second instance of SQL server Management Studio and that will work.
Give it a shot.
|
|
|
|
|
Thanks for the reply
One more qquestion, can u plz tell me the meaning of following line
I cannot define a table without using a Transact SQL
|
|
|
|
|
"I cannot define a table without using a Transact SQL"
This statement is a big vague without knowing some background, but I will try to clarify it.
Transact SQL (TSQL) is the language that MS SQl server uses to manipulate both data and the structure of information stored in the server. TSQL is a superset of the ANSI SQL language, meaning it has additional capabilities that are not defined by the ANSI standard.
Therefore, in order to create a table you must use the language that is supported; in this case the language is Transact SQL.
Does that answer your question, or make it more confusing ?
|
|
|
|
|
In Sql Server Management Studio each time you click New Query it opens a new connection, so there is no problem. In SQL 2005/2008 Management Studio (can't remember 2000) it shows you the SPID number in the status bar, next to your login name.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Temporary Tables are session/connection specific.
So the scope and lifetime of the temporary table is directly linked with the connection or session in which the table is created and another table with the same name cannot be created in the same session.
Similar to the fact that in a database you cannot have more than one table with the same name.
Usually, in most of the occassions using Table Variables instead of temporary table solves the purpose and using table variable is a better practise that using temporary table... also it solves your issue of table creation
|
|
|
|
|
Hi All
I am new with VBA in access.
I have two buttons on access form.when i click on 1 button,my vba code has to run.
how to do that?
pls help me.
Thanks
|
|
|
|
|
Open the form in design view, double click on the button.
That should put you in a code window in the buttonX_Click event (where buttonX is the name of your button).
Now add a call to your code (or place your code here if its not in a sub/function.
Buy a book on Access programming if you intend to do any more - this is something that is one of the first steps in Access programming.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Good Day all
I have a Sp that is written like this
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[Import_RegistrationsXM] @xml ntext
AS
set nocount on
DECLARE @doc int
EXEC sp_xml_preparedocument @doc OUTPUT, @xml
TRUNCATE TABLE _RegistrationXM
INSERT INTO _RegistrationXM
SELECT *
FROM OPENXML ( @doc , 'Import/Item' , 2)
WITH (
Student varchar(32),
SubjectCode varchar(32),
Campus varchar(32),
Repeat bit
)
EXEC sp_xml_removedocument @doc
truncate table _Duplicates
exec( 'sp_RegistrationsXM_Populate' )
select 'XM Registrations successfully imported!' [Result]
i have an XML File that is 3.21mb, when i this Sp with the XML i get the Following Error
Exception caught in: ExecuteStoredProc: Cannot insert duplicate key row in object 'dbo._RegistrationXM' with unique index '_RegistrationXM_index'. The statement has been terminated.
in the table _RegistrationXM there are no Records and in the File there are no Duplicates too.
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Vuyiswa Maseko wrote: in the table _RegistrationXM there are no Records
Its probably rolled everything back when it got the error
Vuyiswa Maseko wrote: in the File there are no Duplicates
I bet there are, SQL doesn't lie about these things.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Good Day Ashfield
There are no Duplicates as i said.The Problem is that there was a Unique index on a certain Field.
Thank you i solved the Problem.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Vuyiswa Maseko wrote: The Problem is that there was a Unique index on a certain Field
.. which means there were duplicate values for this field, otherwise your unique index would not have caused a failure
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Yes but not in a Row Level. Because the Defination of the Field allowed Duplicates in a Field Level.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Vuyiswa Maseko wrote: Yes but not in a Row Level
I kind of expected you would look at the fields that form the unique indices, not look for duplicate rows (although obviously they would also cause the problem).
Anyway, all solved now
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Thanks i never thought there would be an index there, i just inherited the System. thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi all,
I am doing Data Migration using ORACLE and Vb.net 2005. Im transferring Values from one database to another.
Currently,getting values from Source DB and those values are filled in a Dataset,using For loop,the values are inserted into the Destination DB.
The above mentioned method is working fine for Less number of records(500 approx.)
For more than one lakh records,it is not a gud solution. It is taking more than an hour...
How to do BULK INSERTION using ORACLE and VB.NET.
Pls any one help me...
Thanks in advance
|
|
|
|
|
|
Hi all, i know maybe its is really easy but I've been working on it for ages ! (
Name Diploma year
A 1991
A 1986
A 1981
B 2001
B 1996
B 1992
C 1990
C
C
D 2006
D
D
i have a 3-4 tables and join them, then it returns lots of people have diplomas from different
school, but i need to show the last graduated school for everyone. like that
A 1991
B 2001
C 1990
D 2006
.
.
.
.
.
thanks for now ...
Talha
thanks for everything i have...
|
|
|
|
|
select max(diplomayear),[name]
from mytable
group by [name]
Hope this will help you.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
thank you, it works !
thanks for everything i have...
|
|
|
|
|
No problem.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|