I am in the process of migrating from SQL Server 2008 over to 2012. The issue is that on some of the Stored Procedures object names are not matching the name inside of the procedure itself. So, for instance the object name under Programability in SSMS is different than the name in the CREATE PROC. Perhaps the object name was changed. The CREATE PROC procedure sits in the sys.sql_modules table and in the column "DEFINITION" there lies the code. The code is in text. EXAMPLE
CREATE PROC [SCHEMA].OBJECTNAME AS OR IT COULD BE CREATE PROCEDURE [OBJECT] ( Select * from etc )
I need a way of changing the [SCHEMA].OBJECTNAME to match the object name in programmabillity.
As part of a simple maintenance package I am writing, the boss wants it to script out all objects from the database to a text file nightly (or better yet one file per object but that is not a requirement only a "nice to have"). I've been having a surprisingly difficult time determining how to do this.. its simple enough in SSMS but you can't schedule that :) Googling turns up a lot of people asking the same question with no real answers.. SSIS seems geared towards copying all objects to another DB - not just scripting them.
I am looking for a script which capture the object details like constraints, clustered & non-clustered indexes, primary & foreign keys, etc before migration & also after migration and give me the differences after comparison if any. Since this is on production environment, we do not have approval to use any comparison tool. Being a DBA, I am very poor in TSQL programming.script which can compare the differences before & after migration.
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"
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
Would please anyone here give me any idea about how can I connect to SQL Server 2005 analysis services server and send XML request to it programmatically (with Business intelligence development studio in SQL Server 2005)? Thanks a lot.
hi my domain is hosted on a remote server related databases are stored on a seperated DataServer I have the name of that DataServer and i need to create new DBs programmatically
I use this statement on my local machine sqlstat= "CREATE DATABASE dbc_" + dbid + " ON PRIMARY" + "(Name=db_" + dbid + ", filename = '" & Server.MapPath("~/app_data") & "" + dbfilename + "')" but it will not work , because i dont know the physical path i cant use Server.MapPath()
Hi,Does anyone here know whether it is possible to change theauthentication method of a SQL server instance programmatically, ratherthan going through enterprise manager.I am using SQL-DMO (under C#) for some other things, but thedocumentation is so bad that I can't find out whether what I want to docan be done. I have also tried googling but came up empty handed.I hope that someone can help me.CheersJono
.NET 2.0 application (Platform target x86) which executes an SSIS package programatically (using Microsoft.SQLServer.ManagedDTS.dll) The issue I am having is that we connect to a Sybase server and even though the .NET app is executing in 32-bit mode, the SSIS pack appears to try load Sybase 64-bit OLEDB drivers.
The error I receive is DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER
When I run on a 32-bit machine all runs fine or if I run using the 32-bit version of DTEXEC the package also runs fine.
Any ideas on how I can force SSIS to use 32-bit drivers when run on 64-bit server programatically?
In deploying SQL Express, how do I create a new server (INSTANCENAME)programmatically?What would be the best approach to accomplish this.Thank you so much,
I have a web application I created in asp.net + sql2005 and am deploying a genercized version of it to multiple clients. I have created a script which dynamically generates a database to a server and creates all of the tables, procs, and views. I now need data from the old database, which will be imported into the new database. It's basically default users, lookup values, etc. What are some methods of getting this data out of the old server and into the new server? I was thinking about generating flat files with the data, then writing code to loop through and insert the data, but it seems very tedious. Do I have any other options? I cannot use Backup and Restore because I have no access to the new sql server's filesystem.Thanks.
In SQL 2005, the linked servers are not automatically enabled for RPC / RPC OUT like they were in SQL 2000. I have set the properties for my linked server by using SQL Management Studio.
I right click on the Linked Server --> Properties --> Server Options
There are options like: Collation Compatible, Data Access, RPC, RPC OUT, Use Remote Collation
There is a drop down box to set each value to TRUE or FALSE. Setting them through management studio works great, however for the production environment I need to set these properties programmatically. Is there a stored procedure or registry setting that would allow my program to set these values for a given linked server?
i want to import flat file data to sql server. i created a package in vb.net. if the import table column is identity means i got
Failure inserting into the read-only column "ID". Column metadata validation failed. "component "OLE DB Destination" (10)" failed validation and returned validation status "VS_ISBROKEN". One or more component failed validation. There were errors during task validation. error.
how can i rectify this error? or how can i ignore the identity column in coding.
I was just doing a table import task (right click database name/Tasks/Import Data), not knowing my boss had just loaded the same file. it did not warn me that the table currently existed. It just appended the same information to the same table, doubling it. I fixed that one, but, it seems that I might have done this myself in the last couple of weeks, and I'd like to find that table, and there have been a LOT of table loads.
I'm thinking I could get the difference between tables by comparing:
select distinct count(*) from tblname against select count(*) from tblname
But how do I incorporate this into some sort of proc that will go through all the tables and let me know where the issue is? I'm swamped and don't have the time to go through each table manually.
I have code that shows me row counts, and have been able to eliminate a few tables from contention, as they are loading monthly data that should only increase minorly month to month, so, no double jumps there.
I have created many shared datsources and reprots at http://localhost/resportserver.
I am trying to access these reports from ReportViewer in the web application. Actually I want to use these reports for different customers by just changing the datsource programitically.
I am trying to call a SSIS package from a web service hosted on the same machine as the package file is sitting. The package is running fine from the Agent and also by the "Integration Services Project" in VS.NET.
I had a lot of problems with permissions but they are resolved, at least I have no error messages to point to that direction. Now I am getting these results:
1. Error: -1073659874 / Description: The file name "\Diver-svrInputDataFilesdn_cust.txt" specified in the connection was not valid.
hi, We have machine where SQL 2005 server is installed.Atleast 3 web applications are running on it with data size 22GB in all. We need to migrate all data/tables/groups/users from this server to another server.On target server, SQL server 2005 will be installed.After that this migration activity needs to be carried out.what are options available to migrate to target server? Microsoft migration tool? Any already existing stored procedure etc?which is preferred solution in such case?
We have sql server 7 Sqlserver ServicePack SP3 Sort Order = 32 BuildNumber 7.00.961
on Windows NT,Now we are planning to upgrade operating system from win NT machine to windows 2000. Please let me know what and all precausion do i need to take what and what all backup should be done apart from user database. How do i take care of the users,logins,roles, DTS Job and Replication.
Please help me in this and also any links if u have on this topic
Soon I shall have to migrate 2 medium sized databases from SQL server 7 to 2005. Any words of wisdom, “how to�, “do and don’t� would be greatly appreciated.
Here are the details: SQL 7.0 SP4, on Win2000 SQL 2005SP1,on Win2003
Sql 2005 needs to be installed on a new server (Win 2003), which will also be used as a web server (IIS6). I was thinking to go with a clean install for sql 2005 first, and after that to migrate the databases.
When i tried to migrate to SQL Server 2005, it is working fine in the SQL Server 2005 installed in Windows 2003 Server. System tables(syscolumns, sysobjects etc)are created in "Database->Tables->SystemTable".
But when i tried to run in SQL Server 2005 installed in Windows XP, I'm facing the following problems.
1."The object 'CK_SavedSear_LastL_4B422AD5' is dependent on column'LastLoadedTime'
"ALTER TABLE DROP COLUMN LastLoadedTime failed because one or more objects access this column"
2.Moreover none of the tables had been created in "Database->Tables->SystemTable".
In both XP and 2003 Server, While installing, i have choosen same options.
Please anybody could help me to resolve this issue.
I'm migrating 15 user databases from one server to another. The current production server is Windows 2000 Server SP4 and SQL Server 2000 Standard Edition SP4. The new production server is Windows 2003 Server and SQL Server 2000 Enterprise Edition SP4. The new server does not have the same directory structure as the current server.
I plan to detach the database, move the .mdb and .ldb files to the new server and then attach the database again. I'm not sure what to do with the master and msdb databases. Do I need to bring over the master? I know I need the msdb for all the job information. Since these are system databases, do I need to follow a different process? I want to get all these databases over to the new server so I can begin some parallel testing prior to the final cutover.
For anyone that has gone through this process, is there anything that I need to pay special attention to? Any issues moving from Windows 2000 to Windows 2003 or SQL Server 2000 Standard to SQL Server Enterprise Edition?
When i tried to migrate to SQL Server 2005, it is working fine in the SQL Server 2005 installed in Windows 2003 Server. System tables(syscolumns, sysobjects etc)are created in "Database->Tables->SystemTable".
But when i tried to run in SQL Server 2005 installed in Windows XP, I'm facing the following problems.
1."The object 'CK_SavedSear_LastL_4B422AD5' is dependent on column'LastLoadedTime'
"ALTER TABLE DROP COLUMN LastLoadedTime failed because one or more objects access this column"
2.Moreover none of the tables had been created in "Database->Tables->SystemTable".
In both XP and 2003 Server, While installing, i have choosen same options.
Please anybody could help me to resolve this issue.
Scenario Recently moved a SQL2000 database to SQL2005. Collation on SQL 2000 database server was SQL_Latin1_General_CP1_CI_AS Colaltion on SQL 2005 database server is Latin1_General_CI_AS
After restoring the SQL 2000 database on SQL 2005 we observed that the database collation was SQL_Latin1_General_CP1_CI_AS. We have altered the database collation to Latin1_General_CI_AS. We understand this will work for all new objects created on the database but existing objects (prior to the collation change) will continue to have the 'SQL_Latin1_General_CP1_CI_AS' collation.
What is the best method to change the collation of the older columns to 'Latin1_General_CI_AS' - 1) Run ALTER TABLE ALTER COLUMN <colname> <datatype> COLLATE Latin1_General_CI_AS <nullability> on each varchar/char column
or
2) For each table BCP out data DROP TABLE RECREATE TABLE (taking the new collation Latin1_General_CI_AS) BCP in data
Recently we had multiple production failures because one database was in single-user mode. I am trying to recreate this scenario to write a script that will kick out that connection that was holding database in single-user.In SSMS window 1 I run the following code:
use master go alter database test set single_user with rollback immediate
[code]....
Yes, it shows one record, but the database name is master, not test. And indeed, I run it from the context of master. Also tried sp_who, sp_who2, sys.dm_exec_requests - nothing works. For dm_exec_requests it shows nothing because it does not run at the current moment.Any other solutions to catch this SPID with a script?
hi, i need some help here,i made a simple data driven website in my development PC, at first, i used MS Access for my data base then i migrate it to sql server express 2005, and it works fine when i try to run it in my development PC with my IIS. but of course i will be deploying it to a real server, in our office were i will deploy my data driven site, we have a PC server Win Server 2003 with SQL Server 2000 Enterprise (im not pretty sure by the name but i know its not a free version, its something like a 2000 sql version with a word enterprise at the end).so my question is, i am developing an ASPdotNET site originally used SQL server 2005 express,how can i migrate my site to the Win Server 2003 and my database from SQL Server 2005 express to SQL server 2000 enterprisewill it work?? if not, what are the possible solution that i can do in cases like mine?i used Visual Web Developer 2008 Express Ed. in making my sites, and its DOES NOT allow databases in SQL Server 2000!!!!!it says "can't recognize the database"i hope you can help me with this.Thanks-SALAMAT PO....=)
We are in the process of Migrating our SQL Server 7.0 databases to SQL Server 2000. We have purchased two new servers for this process. What is the best method for the Database Migration ? - Copy Database Wizard ? - DTS ?
I would like to migrate an access data to SQL Server. However, the Access database has an OLE data type field that stores word documents. Is there a way to handle this in SQL Server?
Hi! I have an SQL server installation with a 6.5GB database online at a particular location. I need to move the Database to another location which is a 1000 Miles away.
I have an additional physical Server at the other location which I can use to Sync the database from the original location. Can anyone please guide me to the best strategy to sync the database from the original location to the new location with minimum downtime??