Showing posts with label sps. Show all posts
Showing posts with label sps. Show all posts

Sunday, March 11, 2012

Compare sql (SQL DIFF)

hi,
I am looking for a program or utility that it could compare sql server table
schema, views, triggers and sps?
not sure which program is better. Suggestions please.
ThanksTry Red Gate SQL Compare (www.red-gate.com).
Ben Nevarez, MCDBA, OCP
Database Administrator
"mecn" wrote:
> hi,
> I am looking for a program or utility that it could compare sql server table
> schema, views, triggers and sps?
> not sure which program is better. Suggestions please.
> Thanks
>
>|||Thanks
"mecn" <mecn2002@.yahoo.com> wrote in message
news:u90BoMRpGHA.4032@.TK2MSFTNGP03.phx.gbl...
> hi,
> I am looking for a program or utility that it could compare sql server
> table schema, views, triggers and sps?
> not sure which program is better. Suggestions please.
> Thanks
>|||Red-gate rules!
"mecn" wrote:
> Thanks
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:u90BoMRpGHA.4032@.TK2MSFTNGP03.phx.gbl...
> > hi,
> >
> > I am looking for a program or utility that it could compare sql server
> > table schema, views, triggers and sps?
> > not sure which program is better. Suggestions please.
> >
> > Thanks
> >
>
>|||Try ApexSQL's SQLDiff tool.
www.ApexSQL.com
--
Arnie Rowland*
"To be successful, your heart must accompany your knowledge."
"mecn" <mecn2002@.yahoo.com> wrote in message
news:u90BoMRpGHA.4032@.TK2MSFTNGP03.phx.gbl...
> hi,
> I am looking for a program or utility that it could compare sql server
> table schema, views, triggers and sps?
> not sure which program is better. Suggestions please.
> Thanks
>|||mecn,
The free, open-source SchemaCrawler tool will do what you need.
SchemaCrawler outputs details of your schema (tables, views,
procedures, and more) in a diff-able plain-text format (text, CSV, or
XHTML). SchemaCrawler can also output data (including CLOBs and BLOBs)
in the same plain-text formats. You can use a standard diff program to
diff the current output with a reference version of the output.
SchemaCrawler can be run either from the command line, or as an ant
task. A lot of examples are available with the download to help you get
started.
SchemaCrawler is free, open-source, cross-platform (operating system
and database) tool, written in Java, that is available at SourceForge:
http://schemacrawler.sourceforge.net/
You will need to provide a JDBC driver for your database. No other
third-party libraries are required.
Sualeh Fatehi.

Friday, February 24, 2012

Communicate XML between SP’s

Hi,
I have two databases and need to transfer data between them. The problem is
that I’m facing the 8000 characters limitation of a varchar and I cannot use
a text declaration within the trigger/SP itself. Therefore I had the
following idea:
SP 1:
CREATE PROCEDURE [DBO].[testXMLSelect] AS
declare @.idoc as int
--Load and parse the XML document in Memory
EXEC sp_xml_preparedocument @.idoc OUTPUT select * from testtext where id=3
for xml auto
exec testXMLInsert @.idoc
--now clear the XML document from memory
EXEC sp_xml_removedocument @.idoc
GO
SP 2
CREATE PROCEDURE [dbo].[testXMLInsert]
@.idoc as int
AS
insert into testtext (test)
select test from openxml(@.idoc,'/testtext',0) WITH (id int, test text)
GO
My Idea was to parse the handle to the XML document in Memory from one to
the other SP, and later on to the other database (same server). Does anyone
have an idea how to solve this?
Regards,
Merijn
You cannot use a select statement as a parameter to a stored procedure...
assign the result to a variable and pass the variable.
Also, you may want to upgrade to SQL Server 2005 where you don't have the 8k
limit anylonger (and have XML data type and much more).
Best regards
Michael
"Merijn" <Merijn@.discussions.microsoft.com> wrote in message
news:482A7B95-4FC7-4C36-B4C9-BDFDAC76C31C@.microsoft.com...
> Hi,
> I have two databases and need to transfer data between them. The problem
> is
> that I'm facing the 8000 characters limitation of a varchar and I cannot
> use
> a text declaration within the trigger/SP itself. Therefore I had the
> following idea:
> SP 1:
> CREATE PROCEDURE [DBO].[testXMLSelect] AS
> declare @.idoc as int
> --Load and parse the XML document in Memory
> EXEC sp_xml_preparedocument @.idoc OUTPUT select * from testtext where id=3
> for xml auto
> exec testXMLInsert @.idoc
> --now clear the XML document from memory
> EXEC sp_xml_removedocument @.idoc
> GO
> SP 2
> CREATE PROCEDURE [dbo].[testXMLInsert]
> @.idoc as int
> AS
> insert into testtext (test)
> select test from openxml(@.idoc,'/testtext',0) WITH (id int, test text)
> GO
> My Idea was to parse the handle to the XML document in Memory from one to
> the other SP, and later on to the other database (same server). Does
> anyone
> have an idea how to solve this?
> Regards,
> Merijn
>
|||On Feb 23, 8:42 am, Merijn <Mer...@.discussions.microsoft.com> wrote:
> Hi,
> I have two databases and need to transfer data between them. The problem is
> that I'm facing the 8000 characters limitation of a varchar and I cannot use
> a text declaration within the trigger/SP itself. Therefore I had the
> following idea:
> SP 1:
> CREATE PROCEDURE [DBO].[testXMLSelect] AS
> declare @.idoc as int
> --Load and parse the XML document in Memory
> EXEC sp_xml_preparedocument @.idoc OUTPUT select * from testtext where id=3
> for xml auto
> exec testXMLInsert @.idoc
> --now clear the XML document from memory
> EXEC sp_xml_removedocument @.idoc
> GO
> SP 2
> CREATE PROCEDURE [dbo].[testXMLInsert]
> @.idoc as int
> AS
> insert into testtext (test)
> select test from openxml(@.idoc,'/testtext',0) WITH (id int, test text)
> GO
> My Idea was to parse the handle to the XML document in Memory from one to
> the other SP, and later on to the other database (same server). Does anyone
> have an idea how to solve this?
> Regards,
> Merijn
I have a requirment to share data between two databases and I'm hoping
you could outline to me the steps you have taken to get me started. I
won't run into the varchar limit in my application.
Thanks,
lq
|||On Feb 25, 9:54 am, "Lauren Quantrell" <laurenquantr...@.hotmail.com>
wrote:
> On Feb 23, 8:42 am, Merijn <Mer...@.discussions.microsoft.com> wrote:
>
>
> I have a requirment to share data between two databases and I'm hoping
> you could outline to me the steps you have taken to get me started. I
> won't run into the varchar limit in my application.
> Thanks,
> lq
Now that you mentioned the Server is same, but have 2 seperate DBs,
how about using DB Name of the 1st DB in your QUERY of 2nd DB;
something like this
In DB2, you have your query as
Create table #t (MyXMLColumn XML )
Insert INTO #t (MyXMLColumn)
Select <WhatEverXMLColumnNameYouWant> From
<DBName>.<ObjectOwner>.testtext where id=3
|||On Mar 4, 2:59 pm, prabh...@.gmail.com wrote:
> On Feb 25, 9:54 am, "Lauren Quantrell" <laurenquantr...@.hotmail.com>
> wrote:
>
>
>
>
>
> Now that you mentioned the Server is same, but have 2 seperate DBs,
> how about using DB Name of the 1st DB in your QUERY of 2nd DB;
> something like this
> In DB2, you have your query as
> Create table #t (MyXMLColumn XML )
> Insert INTO #t (MyXMLColumn)
> Select <WhatEverXMLColumnNameYouWant> From
> <DBName>.<ObjectOwner>.testtext where id=3- Hide quoted text -
> - Show quoted text -
In my case it's two different servers I cave to communicate using SOAP/
XML to send data from the SQL Server 2000 database to the remote
server.

Tuesday, February 14, 2012

Command Prompt

I apologize for asking a stupid question....I have Windows 2003 Server
installed, I am using SQL Server 2000 with all the sp's installed. I have
created db etc by utilizing the Enterprise Manager....I have been using a
SAMS book to learn some things however the very most basic rudimentary thing,
I have no clue.....
there are many examples that tell you to issue commands...where do I find
the command lines in SQL? Thanks for entertaining my humourous question...I
am not a programmer so I apologize in advance!!!
I can′t dtermine what you mean with command line, if you want the Dos (shell)
command line you can use XP_cmdshell and extended procedure to fire commadn
to the database, if you want to fire up some SQL commandsyou should head for
the Query Analyzer whcih is part as a client component of SQL Server or the
command line utility OSQL.exe which can be executed through the commadn line
in dos mode.
HTH, Jens Suessmeyer.
"SQL Brad" wrote:

> I apologize for asking a stupid question....I have Windows 2003 Server
> installed, I am using SQL Server 2000 with all the sp's installed. I have
> created db etc by utilizing the Enterprise Manager....I have been using a
> SAMS book to learn some things however the very most basic rudimentary thing,
> I have no clue.....
> there are many examples that tell you to issue commands...where do I find
> the command lines in SQL? Thanks for entertaining my humourous question...I
> am not a programmer so I apologize in advance!!!