Hello,
I am trying to bulk isnert XML Data into SQL Server 2008 Express with SQLXMLBulkLoad Object Model from C# (Visual Studio 2010).
My problem is that I am stuck with the relationships. Consider the following annotated XSD file:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
...
I would like to automate script generation (in SSMS --> Tasks --> Generate Scripts) in SSMS 2008. I have read that SQL Server 2008 does not support Database Publishing Wizard (including SQLPUBWIZ SCRIPT) but this automation can be done using SMO in SQL Server 2008. I don't have a clue about SMO and how to do this using SMO, so could you ...
I have a batch job that synchronizes data between two identical databases using the MERGE statement. Sometimes, I get the following error: cannot insert duplicate key row in object 'dbo.MatchPlayerStatistics' with unique index 'IX_MatchPlayerStatistics_Player'. That does not make sense because IX_MatchPlayerStatistics_Player is not a uni...
hi,
Could you tell me how to remove the database name from the table's name.
Each time I create a table the database name is automatically prefixed to the name
this is my table definition
Create table Links
(
Id Int IDEntity(1,1) ,
DisplayName Varchar(250) NOT NULL,
Href Varchar(250) NOT NULL,
Tooltip Varchar(550) NOT NULL,
IsVisible...
Hello,
I have a SQL Server 2008 database. This database has 2 tables:
Manufacturer
------------
ID,
Name nvarchar(256)
Product
-------
ID
ManufacturerID
Name nvarchar(256)
My application has a search box. I do not know if the user is going to provide a manufacturer name or a product name. In addition, I'm trying to be a little bit g...
Hi,
I have a windows account with users group and trying to exec the sp_send_dbmail but getting an error: profile name is not valid. However, when I logged in as administrator and execute the sp_send_dbmail, it managed to send the email so obviously the profile name does exist on the server.. can anyone pleas help?
...
Hello, I have DataBase with enabled Service Broker. Then I want to restore my database in program from backup of other database, but after restoring(I restore on existing database name), my method, whitch enables Service Broker, puts this error:
Msg 9772, Level 16, State 1, Line 1
The Service Broker in database "ServeDB2" cannot be ...
I have a process that needs to select rows from a Table (queued items) each row has a quantity column and I need to select rows where the quantities add to a specific multiple. The mulitple is the order of between around 4, 8, 10 (but could in theory be any multiple. (odd or even)
Any suggestions on how to select rows where the sum of a...
I have an index view which I run a query against with
WHERE GETDATE() BETWEEN start_date AND end_date
in the WHERE clause.
I suspect that the answer to my question is probably going to be no, but, is it possible to push this into the index view or do something clever to achieve the same effect?
My concern is that what the index vi...
I am working on a scalar value function in MSSQL 2008. I created it and It is shown in object Explorer But when I use this function in MS Query Analyzer It gave me error
**Msg 208, Level 16, State 3, Line 1
Invalid object name 'calculatecptcodeprice'.**
For Me this type of error after creating Function is new. What went wrong. Please ...
Hi All,
In my enterprise project we have nearly 800 tables with 7 staging areas. We have developed nearly 100 packages to implement the DW.
Business users constantly chaging the requirements after completing all the packages like table/column names, PK/FK columns with many other changes due to business requirements.
Being changes in t...
Hi,
Why does the following query work, when there is no column named Agentid in the "NewAccounts"-CTE?
WITH
NewAccounts AS (
SELECT 3 as Newaccountid
),
MovedAUM AS (
SELECT 1 AS Agentid, 2 as Col2
)
SELECT * FROM MovedAUM WHERE agentid IN (SELECT Agentid FROM NewAccounts)
The following, modified query returns the error mess...
Looking to document a database schema after the event.
I know red gate software have a commerical tool for this.
I'm looking for a free tool to generate a word document from a SQL Server database.
...
Hi All,
I am planning on using a recursive table in my data model so that I can support an undetermined number of children that can live under a parent. My example is a Table of Contents where I don't know how deep my subsections will be under a chapter.
The issue I am stumbling over is what techniques do folks use to populate there ...
Hi, I am trying to order a query by two keys. The query is built with several subqueries. The table contains, beside columns with other data, two columns, Key and Key_Father. So I need to order the results since SQL to print the results in a report. This is an example:
Key Key_Father
4 NULL
1 4
2 4
7 ...
I am used to oracle and now been thrown T-SQL, I am doing a course shortly but can you help out until then.
I have a list that I need to group in minutes.
Sample of rowdate data
SELECT ROWDATE,count(rowdate)
FROM [mydb].[dbo].[mytable]
GROUP BY ROWDATE
order by 1
2010-08-16 15:01:18.110 1
2010-08-16 15:01:18.203 1
2010-08-16 15:01:18...
I'm working with a system which had to create objects in one database based on objects being created in another database. The objects are not duplicates, so I can't simply replicate the objects.
I have code below which gives a simplified demonstration of what I'm trying to do. If you uncomment the ALTER DATABASE statements then it will ...
A while back when I was performing some bulk inserts of data into my SQL Server database, I disabled a number of indexes to improve the insert performance. I now need to go back and rebuild/re-enable them.
Unfortunately, I'm not sure exactly which indexes I disabled.
Is there a way I can query to identify which indexes are disabled an...
I get an "Class not registered" error whenever I attempt to connect to the integration services on sql server 2005 from within SQL Managment Studio 2008.
Is there a workaround? or do I have to downgrade to SQL managment studio 2005?
...
I'm looking forward to generate our database script by using the script generated by nHibernate. We use Fluent nHibernate to create our mapping.
In our original database design, there is a few xml columns that use the following schema:
CREATE XML SCHEMA COLLECTION LocalizedValue AS
N'<xs:schema attributeFormDefault="unqualified" eleme...