SQL Server 2012 :: Select Data From XML - Objects Within Objects?
Nov 20, 2013
passing serialised objects to a stored procedure for the purpose of data inserts. I see this as being a way to handle multiple row inserts efficiently.
However, in my limited use of XML data I am not so sure how to link the data when I have a dependency on another "object" within the serialised XML.
Below is a code snippet showing what I have so far.
The first insert statement works fine - but how to retrieve the identifier created by the DB - I want to use an SQL statement that finds the record in the table based on the XML representation (of the PluginInfo), allowing me to insert the ConfigurationInfo with the correct reference to the PluginInfo
DECLARE @Config NVARCHAR(MAX)
DECLARE @Handle AS INT
DECLARE @TransactionCount AS INT
SELECT @Config = '
<ConfigurationDirectory >
<ConfigurationInfo groupKey="Notifications" sectionKey="App.Customization.PluginInfo"
I am writing a script to get all of the user objects out of a database. What I am having a hard time doing is filtering out the MS replication system objects, such as:
please help newbieI need to create a lot of objects the same type (let's say: schemas)I wish to use paramerized block in loop to do so.- how to put names of my objects to such control-flow?belss you for help
I recently upgraded to on 2012 SP1 CU5 and have found the SSDT gui for SSIS to be almost unusable. I can't drag or resize items. Any time i try they either automagically shrink to the tiniest possible size, shoot off to some extreme or just shake uncontrollably I didn't have these problems on previous versions (dont remember what It was).
How to alter all objects in database i want to find if can any syntax errors in my database after restoring from sql 2008 to 2012. I Can create as test and drop them but trying to find a way to alter proc , views and functions..
Copy objects and data between SQL Server databases " Display the Select Objects to Transfer dialog box, where you can specify both objects and data to copy, if both the data source and destination are Microsoft® SQL Server™ databases. The objects you can transfer include tables, views, stored procedures, defaults, rules, constraints, user-defined data types, logins, users, roles, and indexes. You can transfer objects only between multiple instances of SQL Server version 7.0, from an instance of SQL Server 7.0 to an instance of SQL Server 2000, and between multiple instances of SQL Server 2000. "
can I apply "Copy objects and data between SQL Server databases" to run in two different sqlserver 2000 ( not an instance ) . what I mean is I have two different sql servers located in two different locations( I am not using an instance installation) can I still run the copy and get an identical database in both servers. Q2. if I have two sql server 2000 with different collations (one is binary and the other is the default) will I be able to run the copy wizard and still have an identical copy of sql server in both servers.
I personally tried to run the copy wizard and IT NEVER WORKED FOR ME and I really do not know the reason.
i have the export data from oracle to sql server. how can i do it. i tried through the wizard i am able to improt from oracle to sql server. but constratins are defined in oracle table are not comming in slq server.
i want to transfer data from oracle to sql(like tables,other database objects from oracle to sql).
Using import task only can select and copy tables and views.
Since there are many objects at the same DB I don't need copy, is there any way let me select and copy some objects, such as functions, stored procedures?
I want to create a login with some restriction like the following...
1.I will create a login and ll mapped to a particular DB with the Database Role 'db_datarerader' only, 2.We wants to display the all objects under a DB but we don't want to provide the View Definition to that particular Login. 3.If we Deny the View definition option he can't able to see the Objects which are there under the DB. 4.So My Clear Question is we want to display the Object like tables ,Sps...etc and we don't want to allow him to view the definition of those objects....
I would like to maintain version control of the all the sql objects (sp, view , tables ) and maintain source code versions control. Any way to use TFS to maintain versions of sql objects. Also the folder structure when using TFS.
I have installed SQL Server 2012 Express edition SP1 in my system. I have created a database in the instance. Now when I try to generate scripts of tables using Right click on database > Click on Task > Click on Generate Scripts, it is showing Error in Action 'Getting the list of objects from <database>'.
I have been creating databases in SQL 2008 with a primary filegroup for the system objects and a secondary, marked Default, for the data.
We are preparing a migration to SQL 2014, and the administrator is complaining he won't adopt this structure on the new servers because 'there is no benefit' and 'a backup cannot be restored (!?)'.
We are running SQL Server 2012 on Windows 2008 Server. In one database, we would like to create a view which access objects in another database without giving the user permissions to the underlying base tables in the other database. The ownership chain is broken in this case. Can this be accomplished (considering the ownership chain is broken)? If so, what is the easiest method to accomplish this task? Or
Example 1 (Works):
In DB1: --UserA selects from Schema1.View1 (which access tables in DB2).
In DB2: --UserA exists with select permissions on the base tables accessed by Schema1.View1 (in DB1).
Example 2 (trying to accomplish):
In DB1: --UserA selects from Schema1.View1 (which access tables in DB2).
In DB2: --UserA exists (or may not exists) with NO permissions on the base tables accessed by Schema1.View1 (in DB1).
Question- Why am I getting 428 pages for which there is no corresponding DB object? Why are so many pages present in sys.dm_os_buffer_descriptors but are missing from sys.allocation_units.
I've a problem.In my MSSql db I've some tables named username.mytable and only onestore procedure named dbo.sp;CREATE TABLE [pippo].[mytable] ([year] [int] NOT NULL ,[month] [int] NOT NULL) ON [PRIMARY]GOCREATE TABLE [pluto].[mytable] ([year] [int] NOT NULL ,[month] [int] NOT NULL) ON [PRIMARY]GOCREATE PROCEDURE [dbo].[sp]ASselect * from mytableGObut when I try to execute dbo.sp (from pippo or pluto connection) I'vethis error (users pippo and pluto are owner):Server: Msg 208, Level 16, State 1, Procedure sp, Line 4Invalid object name 'mytable'.How can I access to pippo's (or pluto's) data from dbo.sp?thanks!!
What is the best approach when transferring all database objects & data from a SQL Server 6.5 database to SQL Server 7.0 database running on different servers.
We have decided to use business objects in our new application, which seems to be working well, since they can be used as a binding source for grids, etc.
I am trying to evaluate whether SSIS is a practical solution for our ETL requirements. The problem is, I can't find any examples or references, or even the slightest hint that anyone is using them with business objects. Any attempts to search yield a ton of results which are based on a commercial product called "Business Objects" rather than the design pattern.
It is currently a requirement of our development team that all data access must be done via business objects, rather than communicating directly with the database.
Can anyone provide some more information (besides just suggesting I write a custom connection manager)? Is there anyone who has actually made SSIS work with business objects?
I have recently moved from a Microsoft SQL Server 2000 to a SQL Server 2005.
In the good old Enterprise Manager, when I imported a table from a SQL server to another, I could choose "Copy objects and data between SQL Server databases". When choosen, all primary keys, and default values was copied.
My question is: Is it possible to do the same in Microsoft SQL Server Management Studio with SQL Server 2005? And how do I do it?
I have tried using the "SELECT * INTO NewTable FROM OldTable" statement, but it just drops all information about primary keys and default values.
I want to migrate from one machine to another is it wise to use SSIS "Copy Objects and Data Between SQL Servers" task to accomplish this....migration both data and metadata (in master,model,and msdb ) databases?
I'm currently running SQL Server 2005, and have been exploring the feasibility of grouping users to use a default file group and data file. This would be to group a set of users to have their new tables reside in a specific data file. I only see mechanisms for moving an already existing objects into a file group or to set the entire databases default file group--not a user level association or dynamic assignment of the default for that user, script, etc.
It's not looking good.
I'm looking for confimration that it's not possible or leads on doing so.
I have not used the copy objects wizard that much. I used it today to copy 4views from my dev box to production. It copied the views, but also wiped outmy data in all the tables that the views are built around!!! Inproduction!!!!Can someone provide me some insight into why this happened?Thanks,Chad
My idea is to read in source and destination values from a table and using these values within a ForEach loop dynamically alter the source, destination and mapping on the data flow within the package. My reading on SSIS leads me to believe that these properties are not available for modification at run-time. Has anyone any ideas on how to accomplish this task. I have data in over 200 tables to import every 4 hours so I'd rather have to maintain 1 package rather than 200.
Hi, I want to manage memory relational data in the memory(Insert, delete, return) and manipulate the data via SQL 2005 and CLR database objects. The gool is to manage a table that relatively has a lot of inserts and deletes which takes a lot of IO operations and i want to reduce it. the data itself is not permanant each row deleted from the table after 15-20 minutes. I looked at the extended stored procedure and other CLR enable objects and it seams that they all return data from the database itself. How can i return data that is reside in the memory? Thanks.