How can we help you today? How can we help you today?
way0utwest
Can I ask what changes you're making here? Specifically? Adding a column ought not to do this, but if you are doing other things, this might be an issue. There's no magic to gettting close to zero downtime. We are bound by the rules of SQLServer, and what we want to do with RG tools is make it easy to do what you'd do manually. Recommending a temp table is sometimes good, sometimes bad,but I'd have to know more here about what to do. However, you need to understand the way that your system works and what method for making changes is apporpriate. I do think that some of the more complex changes are better handled with pre/post scripts, and I'm glad these got added for this reason. I also like the SQL Change Automation client in VS, as this gives me complete control and replays the changes in the same way for downstream environments. This lets me control the way we make changes, as I might tackle different column adds in different ways, depending on the table. You won't get zero downtime. You can get very close, and a table rename is often the quickest way. You can front this with a view as well, and recompiling the view to point to a new table is often even quicker, but there are always some locks being held. Here I'd actually do this if I needed  the temp table for the Sales table. 1. Make dbo.Sales2 as the new table, with new schema 2. Copy data from dbo.Sales to dbo.Sales2 (this could be one step 3. Rename dbo.Sales to dbo.Sales_Old 4. Rename dbo.Sales2 to dbo.Sales 5. cleanup any data added between step 2 and 3. If you try to make this one transaction, you won't get zero downtime. If you are trying to add a column and populate all rows with data in the same step, you won't get zero downtime. Actually, you don't get downtime, but blocking. If you provide more information, we can help determine how to attack this problem. / comments
Can I ask what changes you're making here? Specifically? Adding a column ought not to do this, but if you are doing other things, this might be an issue.There's no magic to gettting close to zero d...
0 votes
What's the build target? The only compiler the build process has is the SQL Server engine. If you've targeted LocalDB or a version that doesn't support TRIM(), then things might not work. / comments
What's the build target? The only compiler the build process has is the SQL Server engine. If you've targeted LocalDB or a version that doesn't support TRIM(), then things might not work.
0 votes
The developers are aware this is an issue and they're looking into it. No word on when this might be fixed, but I'm hoping soon. / comments
The developers are aware this is an issue and they're looking into it. No word on when this might be fixed, but I'm hoping soon.
0 votes
Is there broken code after the area you're trying to format? If I get my code into a batch, it seems to format.  If you have an example of the code for me to test, I'd be happy to. I have 9.2.7 on this machine, but 9.2.9 on another. / comments
Is there broken code after the area you're trying to format? If I get my code into a batch, it seems to format. If you have an example of the code for me to test, I'd be happy to. I have 9.2.7 on t...
0 votes
I've noticed this as well. I've sent a note off to see if this is a fundamental behavior change or a bug.  I have been able to get this to work by putting a "GO" before my statement/query and then formatting it. / comments
I've noticed this as well. I've sent a note off to see if this is a fundamental behavior change or a bug. I have been able to get this to work by putting a "GO" before my statement/query and then f...
0 votes
Sorry, this process sometimes is a bit of a chicken and egg, going around in circles when trying to explain the process. In case someone else is following, here's what I recommend. Let's say I have a procedure that I wanted created called dbo.SetDateforClass. This looks like this in my programmable object: CREATE OR ALTER dbo.SetDateforClass<br>&nbsp; @ClassID int<br>, @dt date<br>as&nbsp;<br>begin<br>update Class<br>&nbsp;set StartDate = @DTs <br>where ClassId = @ClassID<br>end I add this to my database and then add a migration script that looks like this. <!-- migrationid = xxxx --><br>exec dbo.SetDateforClass 1, getdate()<br>exec dbo.SetDateforClass 2, getdate() Now, when I refresh the project, this compares to the shadow database. The migration scripts execute first, then the programmable objects. In this case, I'll get an error as the proc doesn't exist in Shadow yet, so the script fails. This worked in the main development database since the chronology was correct in how I built the objects. To fix this, I recommend this: change the migration script to: <!-- migrationid = xxxx --><br>if not exists( select name from sys.objects where name = 'SetDateforClass')<br>&nbsp; begin<br>CREATE OR ALTER dbo.SetDateforClass<br>&nbsp; @ClassID int<br>, @dt date<br>as&nbsp;<br>begin<br>update Class<br>&nbsp;set StartDate = @DTs <br>where ClassId = @ClassID<br>end<br>goexec dbo.SetDateforClass 1, getdate()<br>exec dbo.SetDateforClass 2, getdate() This will deploy the procedure as part of the migration script and then execute it. Later, the programmable object will overwrite this procedure with the same definition and the compare with the Shadow db for validity, as well as a build or downstream deploy, will work. If the procedure gets updated with a new parameter or different logic, that will be deployed, but this migration won't run again. However, if a new developer sets up from scratch, when they load the project and pick databases, this migration script will work (likely no data, so no effect) and then the updated procedure definition will be deployed as a part of the programmable object deployment. / comments
Sorry, this process sometimes is a bit of a chicken and egg, going around in circles when trying to explain the process. In case someone else is following, here's what I recommend.Let's say I have ...
0 votes