Linking to DB using Perforce
kckndrgn
Posts: 4
OK, after creating a new client name to get past the first problem I had I now have another one.
When linking to Perforce, I enter the working folder, select Perforce for the source control and click "link".
here is the error i get:
Command:
P4 -s submit -d "Database project file added by Red Gate SQL Source Control" "C:\Depot\SQL\..."
Output:
error: No files to submit from the default changelist.
exit: 1
Exit code:
1
Do I need to have the SQL stored procedures already there from the DB?
Really confused on the setup documentation, nothing is very clear.
When linking to Perforce, I enter the working folder, select Perforce for the source control and click "link".
here is the error i get:
Command:
P4 -s submit -d "Database project file added by Red Gate SQL Source Control" "C:\Depot\SQL\..."
Output:
error: No files to submit from the default changelist.
exit: 1
Exit code:
1
Do I need to have the SQL stored procedures already there from the DB?
Really confused on the setup documentation, nothing is very clear.
Comments
The error you're getting occurs when P4 thinks there's nothing to commit. I've seen this before but I don't precisely recall the cause unfortunately.
Can I first check what you're linking to? I noticed "Depot" in the path which suggests you may be linking to where your actual Perforce Depot is located, which isn't how it would normally do it.
The usual method, summarised, is to create a folder under an existing workspace (or create a new workspace) on your PC, specifically for the DB you're linking.
On my PC, P4V is currently using workspace "c:\MyWorkspace - the actual Depot is on another server.
So to link Adventureworks, I'd create a folder under there (i.e. C:\MyWorkspace\AdventureWorks) and ensure it's empty, the link SQL Source Control to it.
The linking process creates all the relevant files and folders, and then submits these to the Depot by calling the P4 commit command.
Can you check and see if you're following that process?
Redgate Software
The funny thing is that this DOES work when I specify a workspace and folder under depot such as [C:\Perforce\<MyUsername>_perforce_1666\depot\MyProject\Database]. Unfortunately, that location is not acceptable.
Redgate Software
I started with a Perforce workspace named, "MyWorkSpace" with these directories:
C:\Perforce\MyWorkSpace\MyProject\Code\ApplicationCode
C:\Perforce\MyWorkSpace\MyProject\Code\Database
1. Removed the Database path from the MyWorkSpace workspace and created a new workspace, MyWorkSpace_Database. It is extermely important that you don't have 2 workspaces pointing to the Database path. Otherwise your files can get clobbered & out of sync when you Get Latest.
2. Mapped the new workspace (MyWorkSpace_Database) so that it only points to the database path, [C:\Perforce\MyWorkSpace\MyProject\Code\Database].
3. Opened the folder [%USERPROFILE%\AppData\Local\Red Gate\SQL Source Control 2\CommandLineHooks] in windows explorer.
4. Created a copy of the Perforce.xml file. Opened it for edit.
5. Changed the value of the <Name>Perforce</Name> element to <Name>Perforce [MyProject]</Name>
6. For each of the <CommandLine> elements added the -c MyWorkSpace_Database. For example, the commit command line now looks like this:
<CommandLine>P4 -c MyWorkSpace_Database -s sync "($ScriptsFolder)..."</CommandLine>
7. Saved the XML file.
8. Launched SQL Server and Linked to Source Control. When prompted by Sql Source Control to select the config file for source control commands I chose the one with the Name value from step 5 above.
That worked for me.
Redgate Software