Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Thursday, March 22, 2012

Exporting data as XML file

To get the data from the database table as an XML file we will use " for xml" clause in sql statement in SQLSERVER.

But i am not able to generate the following things in that XML file.

please let me know how to get the following details in XML file using sql statement?

<?xml version="1.0" encoding="UTF-8" ?>

- <listOfIDXRefData xmlns=some url here>

Try the T-SQL forum http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=85&SiteID=1

-Jamie

Wednesday, March 21, 2012

Exporting a table to a file -reg

Dear Friends,
I am having Sql Server 2005 Express Edition. Also I have installed "Sql
Server Management Studio Express".
In "Sql Server Management Studio Express", how to export a table to a csv
file, or to another table?
Thanks & Regards,
Thirumalai.Hi
Use AdventureWorks
--Import to another table
SELECT * INTO Person.Address_New FROM
Person.Address
SELECT * FROM Person.Address_New
--Import to the file
exec master..xp_cmdshell 'BCP AdventureWorks.Person.Address_New OUT
c:\test1.txt -c -C850 -SSERVER\SQLSERVERDEV2005 -Usa -Ppwd'
"Thirumalai" <thirumalai@.cspl.com> wrote in message
news:eiQpaM$SGHA.4452@.TK2MSFTNGP12.phx.gbl...
> Dear Friends,
> I am having Sql Server 2005 Express Edition. Also I have installed "Sql
> Server Management Studio Express".
> In "Sql Server Management Studio Express", how to export a table to a csv
> file, or to another table?
> Thanks & Regards,
> Thirumalai.
>
>

Sunday, March 11, 2012

Export to sqlserver

when i export tables to another database then that table which has columns identity(yes),identity seed=1,increment=1 properties removed on destination table.Why?Identity columns and key constraints are not preserved when using the standard replication service in SQL Server, you must use Transactional Shipping Logs.

Friday, February 17, 2012

Export SQLServer Agent Job?

We have a new SQLServer 2000 installation and are moving over databases from
a SQLServer 7 installation. How do we bring over the SQLServer Agent jobs?
Thanks in advance,
MikeYou can script them... right click, All Tasks >, generate SQL script
"Mike Lopez" <mikelpez@.optonline.net> wrote in message
news:Ort9RfQYDHA.2284@.TK2MSFTNGP12.phx.gbl...
> We have a new SQLServer 2000 installation and are moving over databases
from
> a SQLServer 7 installation. How do we bring over the SQLServer Agent jobs?
> Thanks in advance,
> Mike
>|||> Once the script is generated what then? Copy it to the new SQL Server 2000
> server and execute it in Query Analyzer?
You might have to adjust server names etc., if they are included in the
script output. But generally, yes, that's the idea. I usually save such
scripts as <jobname>.job.sql files... this way they get the right icon in
Windows explorer, are recognized by Visual Studio / QA, but they also are
clearly marked as a JOB (whereas with the JOB extension, it gets a red x
like a windows scheduled task that doesn't work, at least in W2K3).
And as Chinna points out, you could also use the DTS task "transfer jobs"...

Wednesday, February 15, 2012

Export Schema in SqlServer 2005

Hi all,

sorry for the rather trivial question but I couldn't figure this out by
myself.

How do you export a db schema either from the commandline or from the
GUI (if I remember correctly it's called Management Studio in the new
version).

Thanks in advance,
LorenzoIn Enterprise Manager:
1) open the databases folder
2) highlight the database you want to generate a SQL script for
3) right-click and select "All Tasks..."
4) select "Generate SQL Script"
the "Generate SQL Script" window pops-up.

At this point, I usually just click on the "select all" button near the
top-right corner. You can select objects individually for scripting at
the bottom-left sectio of the window or, at the top-left section, you
can select "all tables", etc.

hth,

victor dileo|||vjdileo wrote:
> In Enterprise Manager:
> 1) open the databases folder
> 2) highlight the database you want to generate a SQL script for
> 3) right-click and select "All Tasks..."
> 4) select "Generate SQL Script"
> the "Generate SQL Script" window pops-up.

Hi Victor,

thanks for your reply... guess that All Tasks didn't say anything good
to me! ;)

Lorenzo