Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Wednesday, March 21, 2012

exporing a table from one dattabse to another

I have a database which is on a network and I want to transfer a table form this databse onto my local machine. Is this possible as in Access they have an export function but I can't find such a thing on sql server expresss.

I have tried copying and pasting the data across but there are over 200,000 rows so I imagine it will take me for ever.

As anyone any suggestions?

Cheers

hi,

SSMSE does not provide SSIS (SQL Server Integration Service) features to allow a task like that, but you can perform the very same activity via standard Transact-SQL code...

SET NOCOUNT ON;

USE tempdb;

GO

CREATE TABLE dbo.originalTB (

Id int NOT NULL PRIMARY KEY,

data varchar(10) NULL

);

GO
PRINT 'populate it with some data';

DECLARE @.i int, @.data varchar(10);

SET @.i = 1;

WHILE @.i < 11 BEGIN

IF @.i % 5 = 0

SET @.data = NULL;

ELSE

SET @.data = RIGHT(REPLICATE('0', 9) +CONVERT(varchar, @.i), 10);

INSERT INTO dbo.originalTB VALUES ( @.i, @.data);

SET @.i = @.i + 1

END;

GO

--SELECT * FROM dbo.originalTB;

GO

PRINT 'Create the destination table on the fly using SELECT INTO statement';
PRINT 'see http://msdn2.microsoft.com/en-us/library/ms189499.aspx as well';

PRINT 'you have to later add all required constraints (check, default, primary key)';

PRINT 'on the destination table as the SELECT INTO does not perform it..'
PRINT 'see SSMSE or further tools like my amScript, available for free.';

SELECT *

INTO dbo.destinationTB

FROM dbo.originalTB

ORDER BY Id;

SELECT * FROM dbo.destinationTB;

GO

DROP TABLE dbo.destinationTB;

GO

PRINT 'Explicitely create the destination table, again, see the "Scripting features"';

PRINT 'of SSMSE or further tools like my amScript, available for free.';

PRINT 'and populate it via a "standard" INSERT SELECT';

CREATE TABLE dbo.destinationTB (

Id int NOT NULL PRIMARY KEY,

data varchar(10) NULL

);

INSERT INTO dbo.destinationTB

SELECT Id, data

FROM dbo.originalTB

ORDER BY Id;

SELECT * FROM dbo.destinationTB;

GO

DROP TABLE dbo.originalTB, dbo.destinationTB;

--<-

Create the destination table on the fly using SELECT INTO statement

you have to later add all required constraints (check, default, primary key)

on the destination table as the SELECT INTO does not perform it..

Id data

-- -

1 0000000001

2 0000000002

3 0000000003

4 0000000004

5 NULL

6 0000000006

7 0000000007

8 0000000008

9 0000000009

10 NULL

Explicitely create the destination table, see the "Scripting feature"

of SSMSE or further tools like my amScript, available for free at

http://www.asql.biz/en/Download2005.aspx

and populate it via a "standard" INSERT SELECT

Id data

-- -

1 0000000001

2 0000000002

3 0000000003

4 0000000004

5 NULL

6 0000000006

7 0000000007

8 0000000008

9 0000000009

10 NULL

regards

Monday, March 19, 2012

Exploit.Win32.WebDav.n

Hello,
My SQL server that sits outside our firewall has been
sending a large ammount of network traffic the last 2
days. It reminded me of the old SQL Slammer virus,
however I have SP3 installed and all virus updates and MS
patches. I noticed a new process called scan1000.exe
running and sending out many packets. I did some research
on this process and sure enough its a worm called
Exploit.Win32.WebDav.n. I removed the scan1000.exe file
from C:\recycler and everything seems alright now. I
found some info on this on McAfee's site, but not Norton
or Microsoft. My SQL server has been fine and its NOT
using a blank password. How did this get on my system and
exploit it? Any information is greatly appreciated.
Thank you.Hi Phil,
It's possible that this machine was comprised any number of ways.
Having your Server outside the firewall is not a good idea. You should
have it behind a firewall and only expose the ports needed.
If you'd like we can assist you with a security review of your system.
You may want to review these articles as well;
SQL Server Best Practices.
http://www.microsoft.com/technet/pr...n/sp3sec04.mspx
Certs Recommendations
http://www.cert.org/nav/recovering.html
Help: I Got Hacked. Now What Do I Do?
http://www.microsoft.com/technet/co...gmt/sm0504.mspx
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Explanation wanted about the Service Principal Name ( SPN )

Hello,

In the ErrorLog of my Sql Server , i found this line :

2007-06-26 05:35:18.37 Serveur The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.

Operating System XP Home SP2

SQL Server 2005 Express Edition with Advanced SP1 )

( idem for another workstation with XP Pro SP2 and same version of SQL Server 2005 Express

My problem is :

i want use the windows authentification but my computers are on Worhkgroup linked by a router ( no window server )

i have read that's possible to connect from a remote computer to a computer having a SQL Server 2005 Express through SPN

How can i do it ? ( activating NTLM ? but how ?)

I'm writing a C# program which must be executing on several computers with a SQL Server 2005 Express installed on a particular computer. These computers will belong to a domain of Windows Server 2003.

As i can't connect to this "normal" network, i am trying to simulate this network at home because i want to test this program and especially the possible locks problems.

I don't know whether i'm querying with the "correct" forum.

Sorry for my poor english.

I shall appreciate any help about this problem

Have a nice day

hi,

actually is not "a problem", as the message in the log already states.. it's informational only..

http://blogs.msdn.com/sql_protocols/archive/2005/10/12/479871.aspx

http://support.microsoft.com/kb/909801/en-us

regards

Friday, February 24, 2012

Existing Oracle Program Prevents SQL Server Express Being Installed in Windows XP Pro that is in

Hi all,

Our Microsoft NT 4 Network has Oracle program for all the Windows XP Pro PC terminals to use. We did not have the SQL Server Express Beta version installed before. Recently our Computer Administrator tried to install the SQL Server Express Edition that is downloaded from Microsoft Website to my Windows XP Pro PC terminal without luck, because the Oracle program is already in our LAN Network and prevents the installation of the SQL Server Express. Please help and advise me how to get the SQL Server Express installed in this situation.

Thanks in advance,

Scott Chang

Hi Scott,

First off, you'll need to take a look at the installer logs to get an idea of why installation failed. The logs are in C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG and C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files.

Second, I'm going to move this to the Setup forum so they can take a look at this once you've come back with information from the logs.

- Mike

|||Can you supply the exact error encountered when trying to install Express, as well as the logs referenced by Mike above?