Quantcast
Channel: SQLServerCentral » Programming » TFS/Data Dude/DBPro » Latest topics
Viewing all 55 articles
Browse latest View live

TFS for databases

$
0
0
Any recommendations how to do db-versioning in TFS? (sqlserver/oracle).

Developing Databases via Visual Studio

$
0
0
After reading an excellent SQLBlog post by Jamie Thompson ([url=http://sqlblog.com/blogs/jamie_thomson/archive/2012/01/01/implementing-sql-server-solutions-using-visual-studio-2010-database-projects-a-compendium-of-project-experiences.aspx]link[/url]) and running through a quick tutorial on Pluralsight by Robert Cain ([url=http://www.pluralsight-training.net/microsoft/Courses#visual-studio]link[/url]), I am a changed man.I've only developed a handful of databases from scratch but I just could not stand working through SSMS and managing a bunch of *.sql files. Not to mention how frustrating it was having to make sure everything appeared in the db-creation script in order of dependency. Don't get me started on Refactoring and Unit Testing...Anyone else have some sources for a beginner?

Schema Compare and Foreign Keys Created WITH NOCHECK

$
0
0
Hi All,We're trying to create a schema synchronization script by comparing a database project in Visual Studio/TFS (source) to a deployed database (destination). The script produced will be used to bring the populated destination database inline with the code checked into Visual Studio/TFS. In TFS foreign keys are defined in the form:[font="Courier New"]ALTER TABLE [dbo].[foo] ADD CONSTRAINT [FK_Foo_Bar] [b][u]WITH NOCHECK [/u][/b]FOREIGN KEY ([Bar_Id]) REFERENCES [Dbo].[Bar] ([Bar_Id]) ON DELETE NO ACTION ON UPDATE NO ACTION;[/font]In the destination database all foreign keys are inactive and marked as untrusted and the underlying data violates the key's logic, i.e. if we were to try and re-enable the foreign keys with CHECK CHECK, it would fail. For info. the only reason that we have the foreign keys in this database is to enable any design tool to show data relationships, we actively do not want the FKs to enforce integrity for operational/performance reasons.When we compare the schema, a difference is picked up between the foreign keys and the source foreign key looks like:[font="Courier New"]ALTER TABLE [dbo].[foo] ADD CONSTRAINT [FK_Foo_Bar] FOREIGN KEY ([Bar_Id]) REFERENCES [Dbo].[Bar] ([Bar_Id]) ON DELETE NO ACTION ON UPDATE NO ACTION;[/font]So the schema comparison tool is stripping off/ignoring the WITH NOCHECK clause and attempting to create the foreign key as active, which causes the script to fail when run over the database (due to the data not adhering to it as described above). Does anyone know of a setting which controls the behavior of scripting FKs, i.e. ignoring this option in the key's script or setting a default of active/inactive at the sync level? Or indeed any information regarding this behavior at all would be very useful?Thanks in advanceOur environment is as follows: Destination database is on a SQL Server 2008 Enterprise (Build 10.0.2531.0) server and we're using Visual Studio 2008, 9.0.30729.1.

Query Work Items in TFS from SQL

$
0
0
Hi AllJust wondering if anyone knows of a way to get Work Item names from the TFSWarehouse database?They are inserted with what I can only really describe as a TFS GUID which I cant seem to translate to a table to get the WI name.Trying to do this via T-SQK direct on the database rather than using WIQL via Visual Studio as its not really that clued up for the information that the people want on the reports.Any help is appreciated.ThanksAnt

Using Views that reference Synonyms in VSTS 2008

$
0
0
I have recently started using Visual Studio 2008 for Database Professionals. We work in an environment with may queries running across databases on the same server and have one set of databases per country. Therefore I use synonyms to keep the code constant and ease the deployment task.However, if a use synonyms in a View, I am hit with a multitude of Build Errors in VS. These are of the form:Error 227 TSD03006: View: [dbo].[vw_AddressProfile] has an unresolved reference to object [dbo].[TransactionHistory]. C:\[i][Database Project Name][/i]\Schema Objects\Views\dbo.vw_AddressProfile.view.sqlIn the above case vw_AddressProfile is the View I am creating and dbo.TransactionHistory is a synonym which references a table in another database. The View works a treat if scripted directly in SSMS - the problem is purely with Visual Studio.I found one source which suggested turning off the "Enable Extended Transact-SQL Verification" option on the Build tab. However that option is not present when I look.Any ideas on how to solve this?

SQL Structure in TFS

$
0
0
I've been elected in my company to devise TFS structure for the maintenance of SQL items. We have 3 versions of SQL still being supported with another on the way. What I am looking for is a recommendation for folder structure within TFS. Our existing VSS databases have entries that are version-specific, like SSIS 2005. I'd like to avoid 'versioning' the storage that way but also make it possible for developers, DBAs and support people to find code easily. Also, out existing VSS has NO database object control so I am treading some new ground here.Since databases can, are and will be used by many projects, I want database and SSAS objects separate from any other project entries. On the other hand I can see bundling SSRS and SSAS with the projects that caused them to be developed.I've seen a lot of conversation here regarding TFS and SQL but haven't found any recommendations for structure. TIA for any suggestions.

Deploy does not detect check constraint changes

$
0
0
I am using SQL Server database project in VS 2010, and am experiencing a weird behavior related to check constraints.I have a table, with 3 columns. For simplicity lets call them column_1, column_2 and column_3.Then I have a check constraint like this:[code="sql"]ALTER TABLE [dbo].[Table1] ADD CONSTRAINT [CheckConstraint1] CHECK (column_1 is not null and column_2 is not null or column_1 is not null and column_3 is not null)[/code]Deploy to database, and everything looks good.Then I change the constraint by adding some parentheses to this:[code="sql"]ALTER TABLE [dbo].[Table1] ADD CONSTRAINT [CheckConstraint1] CHECK ((column_1 is not null and column_2 is not null) or (column_1 is not null and column_3 is not null))[/code]This is obviously quite a different check constraint, but deploy does not seem to catch this change.Anyone got any suggestions?

Any help on this

$
0
0
I need to deploy the solution file from the build path. By giving the build number i need to take all the files inthe corresponding location and put it on the specified location. And i need to change the web config file based onthe new build.

Recommendations for TFS organization structure for DBAs only

$
0
0
Sorry for the misuse of terms. I'm new to source control. Does anyone have recommendations for TFS organization structure for DBAs only? Should our source folder pathing be? $\DBA\username? $\DBA\Servername\Database_name? $\DBA\Servername\Database_name\Project? We thought we try the TFS because we have MSDN subscriptions and have a enough licenses to support the DBA team. We have 500+ SQL servers and 50-100 DBs on each server. We were thinking many of the DBs are third party and we wouldn't need to source control those DBs. But any DBs we do customization or are built and maintenance by us we would want it in TFS server correct?[img]https://lh4.googleusercontent.com/-rFgYEEygxzg/UTdooSJB4KI/AAAAAAAAHkU/CVkAslU59z0/s901/Capture.PNG[/img]

TFS Database Enviornment - Best Practice for Access Rights to Instance

$
0
0
I’ve been tasked to move our TFS databases from the SQLExpress our developers implemented, to SQL 2008 Enterprise. Our developers are planning on retaining complete control over the TFS application server.My concerns are the requirements that the TFS Services, and by extension our developers, require sysadmin rights to the instance where the TFS databases are stored, “Required Permissions .... member of the sysadmin security group for the database instance for Team Foundation …”. This is based on the Microsoft document “Move from a Single-Server to a Dual-Server Deployment” (http://msdn.microsoft.com/en-us/library/ms404854(v=vs.100).aspx) I have also reviewed a blog from Brian Harry (http://blogs.msdn.com/b/bharry/archive/2010/08/20/database-permissions-required-to-configure-tfs.aspx) that discusses fewer access rights, but still elevated (member of serveradmin role, alter any login, CONTROL on the master database.Implementing the TFS databases in this manor goes against the Principle of Least Privilege as I understand it.Are there any suggestions for best practices in implementing a TFS database environment, while limiting SQL instance privileges to the minimum required for TFS to function?Thanks

Check Constraint in Visual Studio 2012 Database Project

$
0
0
We have a VS 2012 .sqlproj database project. We would like to use a scalar valued user defined function to validate one of the table fields in the form of a check constraint.Example:[code="other"]ALTER TABLE [dbo].[MyTable] ADD CONSTRAINT [CK__MyTable__ColHID] CHECK (dbo.fnValidateHierarchy(ColHID) = 1);[/code]What is the proper way to do this?We keep experiencing the following error when adding this to the table definition script:[quote]contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[fnValidateHierarchy] or [dbo].[Mytable].[dbo]::[fnValidateHierarchy]. c:\...\dbo\Tables\MyTable.sql[/quote]

SQLPackage.exe - Lock request time out period exceeded

$
0
0
We are using SQLPackage.exe to publish our .sqlproj to production via Bamboo. On production there is a lot more contention in the database so certain operations take a bit longer to complete. It appears there is a default timeout value of 30 seconds when using SQLPackage.exe and when an operation takes longer than 30 seconds the operation fails with the following message:[quote]*** Could not deploy package.Warning SQL72030: If this deployment is executed, changes to [dbo].[TableA] might introduce run-time errors in [dbo].[TableA].[_dta_stat_1750297295_13_1].Error SQL72014: .Net SqlClient Data Provider: Msg 1222, Level 16, State 56, Line 1 Lock request time out period exceeded.[/quote]When I use the /script option, generate the script, and run the script in the SSMS console the operation completes successfully (just takes a few minutes).Is there any way to configure the lock timeout for SQLPackage.exe? I only see timeout values for establishing connections to the source and destinations but not for the actual execution of the commands.Thank you in advance!

TFS Deployment Automation

$
0
0
Hi,I want to automate the FindLabel in TFS and copy all files to Local path. Is there any comd/powershell command or link which can be helpful to meet my objective ?One way is :- tf get <label Number> but this would refresh the Mapped Folder. I want to save it to Other Folder swapping the WorkSpace Regards,Ankit

TFS VS2010 to SQL Server 2005: No Schema Compare option

$
0
0
Hi,I'm working on a contract and just imported some SQL Server 2005 databases in VS 2010 TFS. The Schemas imported just fine but curiously, when I try to do a schema compare, there is no option for that under the Data toolbar drop down or in the Schema Comparison right-click menu. The Data drop-down only has Transact-SQL Editor and Schema View as options. Am I stuck in some parallel mode that doesn't do schema compares?I'm pretty green on TFS so it's probably user error, just can't figure out what I'm missing. I can see all the object definitions for the databases I imported but no option to compare.Any ideas?Thanks!

TFS Solution Structure Best Practice?

$
0
0
Hi,I'm fighting my way through putting a dozen databases into TFS and am trying to figure out what the most serviceable structure would be. Here's what I've got:SQL Server 2005VS 2012 (you can see where the priorities are!)I've created: 1 Team Project but I'm wondering how to structure the dbs into 'solution(s)' We have 3 DBs that comprise production (and production ETL), 2 DBs that make up our Test set and 2 DBs that make up our Dev set.Has anyone done this long enough to have a recommendation on whether to put all dbs in one solution or to break them out by function--I'm thinking that perms on the solutions might be nice, e.g. don't let just any schmoe have access to the Prod solution.Thanks for your feedback and if you have time, please share any info that was a stumbling block for you!

Using team foundation Server (TFS) within Visual Studio 2013 Shell (Integrated)

$
0
0
Hi,Can anyone help me please with the question:How Can I connect to TFS with Microsoft Visual Studio 2013 Shell (Integrated) Version 12.0.21005.1 RELBackground:installed a new SQL Server 2014 Enterprise.found out, that components for creating Analysis Services Projects (the DataTools) are not included any more.downloaded this Version:http://download.microsoft.com/download/C/9/C/C9C9AFB9-9FA2-4639-A0AD-92C6CC232EA2/SSDTBI_x86_ENU.exeWorks fine, shows as "Microsoft Visual Studio 2013 Shell (Integrated) Version 12.0.21005.1 REL"Now I would like to use TeamFoundation Server as SourceControl for my SSAS-Projects.I can't find a working Setup to make VisualStudio use SourceControl.Tried the following Setups:- TFSSCExplorerExtension_2013- ProPowerTools.vsix- vs_teamExplorer.exetherefore, my Question:How Can I connect to TFS with Microsoft Visual Studio 2013 Shell (Integrated) Version 12.0.21005.1 REL

DB Project Publish Empty string inserting a Zero

$
0
0
Hi, we have a Visual Studio 2013 DB Project which we use to create and populate a test database.We have a table with a varchar NULL column (defaultvalue), and when we run the publish.sql script any INSERT of '' get converted to '0' values.This is the table definition[code="sql"]CREATE TABLE [dbo].[CatalogueItemExtensionFields] ( [RowID] tinyint identity not null, [FieldType] tinyint not null, [Description] varchar(120) not null, [Nullable] bit not null, [DefaultValue] varchar(100) null, [Active_Flag] bit null, [OrderPriority] tinyint not null, [ContextGuid] uniqueidentifier not null);[/code]This is the INSERT statement, and we want to insert an empty string into the "defaultvalue" field[code="sql"]set identity_insert CatalogueItemExtensionFields onINSERT INTO CatalogueItemExtensionFields (rowid, fieldtype, description, nullable, defaultvalue, active_flag, orderpriority) VALUES (1, 3, 'Product Group', 0, '', 1, 1)set identity_insert CatalogueItemExtensionFields off[/code]If we run the above script manually it works fine. But when it is run in SQLCMD mode by the DB project PUBLISH action, we see that '0' is inserted.What we have also done is modify the publish.sql file manually, as follows[code="sql"]set identity_insert CatalogueItemExtensionFields onINSERT INTO CatalogueItemExtensionFields (rowid, fieldtype, description, nullable, defaultvalue, active_flag, orderpriority) VALUES (1, 3, 'Product Group', 0, 'TEST STRING', 1, 1)set identity_insert CatalogueItemExtensionFields off[/code]When we manually execute the publish.sql we get this error:[code="sql"] 'Msg 245, Level 16, State 1, Line 7 Conversion failed when converting the varchar value 'test' to data type int.'[/code]So this means that the SQLCMD thinks the field is an INT, but that is not how it appears in the table definition. Is there an obscure DB setting used in SQLCMD mode?Thanks for your help

Automating SSRS Solution Deployment from Team Foundation Server through SharePoint application

$
0
0
Hi there,I'm currently looking for a solution in order to deploy SSRS solution from our Sharepoint deployment request application. To be more precise : Developpement Team type a deployment demand in a Sharepoint Application, then we are notify by mail that a deployment request occurred. They specify the path of the project and the target server.What I would like to achieve is to set a button on our view of the Sharepoint application, a DEPLOY button, which will automatically deploy the mentioned project by development team, using giving path and target.I found TFSDeployer on CodePlex, but it doesnt really fit my needs.Do anyone can help me by providing some help on this case ? RegardsDam

Confirure TFS

$
0
0
I have a dev server that has a new copy of 2013 Visual Studio, SQL2012, Reports services and now TFS. When I run the TFS setup Wizard it tells me that I may run into issues with SharePoint (and micro blogging). We will only be using SharePoint for TFS and no other reason. The Wizard talks about possible server memory issues running both on the same server. If I'm only installing SharePoint because the Wizard wants to is there any reason then why they all can't reside on the same server?Do I need SharePoint?

DBF EDatabase error

$
0
0
When I try to start a new Database,I've got an error about a field that the Database can't find with the error: EDatabaseError "Field not found" Daysbetween" What can be wrong? Any recommendations?
Viewing all 55 articles
Browse latest View live