Showing posts with label friends. Show all posts
Showing posts with label friends. Show all posts

Wednesday, March 28, 2012

Help for INTRO function

Hello.
I need to create a new table from a query result, then I've written this SQL
command:
"SELECT Name, Number FROM Friends INTRO Result"
BUT
SQL give me an error!!
Please Help Me
Bye
CrisI assume you mean INTO not INTRO
SELECT Name, Number INTO result FROM Friends
http://sqlservercode.blogspot.com/|||Cristian wrote:
> Hello.
> I need to create a new table from a query result, then I've written this S
QL
> command:
> "SELECT Name, Number FROM Friends INTRO Result"
> BUT
> SQL give me an error!!
> Please Help Me
> Bye
> Cris
It's INTO not INTRO.
However, the resulting table won't have any keys or constraints.
Although SELECT INTO is handy as a quick and dirty way to create
tables, it may be better to do something like:
CREATE TABLE Result (name VARCHAR(50) NOT NULL, number INTEGER NOT
NULL, PRIMARY KEY ...)
INSERT INTO Result (name, number)
SELECT name, number
FROM Friends ;
David Portas
SQL Server MVP
--|||Also,
If you need an autonumber in the destination table and need the data ordered
you must create the table first.
Good code:-
Create table myTable ( id int identity(1,1) not null, name varchar(50) not
null )
INSERT INTO myTable ( name ) SELECT name FROM friends ORDER BY name
if you use "select identity(int,1,1) AS id , name into MyTable from ..."
the order is not guaranteed and so it is advised against.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1134382059.521678.242420@.g44g2000cwa.googlegroups.com...
> Cristian wrote:
SQL
> It's INTO not INTRO.
> However, the resulting table won't have any keys or constraints.
> Although SELECT INTO is handy as a quick and dirty way to create
> tables, it may be better to do something like:
> CREATE TABLE Result (name VARCHAR(50) NOT NULL, number INTEGER NOT
> NULL, PRIMARY KEY ...)
> INSERT INTO Result (name, number)
> SELECT name, number
> FROM Friends ;
> --
> David Portas
> SQL Server MVP
> --
>

Wednesday, March 7, 2012

Help - Recovering SQL 2000 Database

Friends,
The SQL server 2000 was running fine until all of a Sudden I got this
message,
SQL Server is aborting. Fatal exception c0000005 caught.
The Service would not start, and I need help in Recovering it.
Any help is greatly Appreciated.
Santosh
Can you check the SQL Server error log and post the error messages here? You
will find the log in MSSQL\Log folder under the installation path.
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Santosh" <santoshNoSpam@.NoSpam.net> wrote in message
news:eHXmsUcmEHA.3352@.TK2MSFTNGP10.phx.gbl...
> Friends,
> The SQL server 2000 was running fine until all of a Sudden I got this
> message,
> SQL Server is aborting. Fatal exception c0000005 caught.
> The Service would not start, and I need help in Recovering it.
> Any help is greatly Appreciated.
> --
> Santosh
>
|||Hi Vyas,
Sorry for the late reply,
The error log just says the below and halts at the last step.
2004-09-13 17:09:54.39 spid11 Starting up database 'jennifertest'.
2004-09-13 17:10:02.75 spid3 Recovery complete.
2004-09-13 17:10:02.75 spid3 SQL global counter collection task is
created.
Do you want any other file like SQLDump?
TIA
Santosh
Can you check the SQL Server error log and post the error messages here? You
will find the log in MSSQL\Log folder under the installation path.
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Santosh" <santoshNoSpam@.NoSpam.net> wrote in message
news:eHXmsUcmEHA.3352@.TK2MSFTNGP10.phx.gbl...
> Friends,
> The SQL server 2000 was running fine until all of a Sudden I got this
> message,
> SQL Server is aborting. Fatal exception c0000005 caught.
> The Service would not start, and I need help in Recovering it.
> Any help is greatly Appreciated.
> --
> Santosh
>

Help - Recovering SQL 2000 Database

Friends,
The SQL server 2000 was running fine until all of a Sudden I got this
message,
SQL Server is aborting. Fatal exception c0000005 caught.
The Service would not start, and I need help in Recovering it.
Any help is greatly Appreciated.
--
SantoshCan you check the SQL Server error log and post the error messages here? You
will find the log in MSSQL\Log folder under the installation path.
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Santosh" <santoshNoSpam@.NoSpam.net> wrote in message
news:eHXmsUcmEHA.3352@.TK2MSFTNGP10.phx.gbl...
> Friends,
> The SQL server 2000 was running fine until all of a Sudden I got this
> message,
> SQL Server is aborting. Fatal exception c0000005 caught.
> The Service would not start, and I need help in Recovering it.
> Any help is greatly Appreciated.
> --
> Santosh
>|||Hi Vyas,
Sorry for the late reply,
The error log just says the below and halts at the last step.
2004-09-13 17:09:54.39 spid11 Starting up database 'jennifertest'.
2004-09-13 17:10:02.75 spid3 Recovery complete.
2004-09-13 17:10:02.75 spid3 SQL global counter collection task is
created.
Do you want any other file like SQLDump?
TIA
--
Santosh
Can you check the SQL Server error log and post the error messages here? You
will find the log in MSSQL\Log folder under the installation path.
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Santosh" <santoshNoSpam@.NoSpam.net> wrote in message
news:eHXmsUcmEHA.3352@.TK2MSFTNGP10.phx.gbl...
> Friends,
> The SQL server 2000 was running fine until all of a Sudden I got this
> message,
> SQL Server is aborting. Fatal exception c0000005 caught.
> The Service would not start, and I need help in Recovering it.
> Any help is greatly Appreciated.
> --
> Santosh
>