Tag Info

Hot answers tagged

3

Redis doesn't do scheduling of jobs/scripts - you'll have to use something (e.g. cron) to trigger the script. The script itself sounds simple enough - LRANGE should be used to iterate the list's elements, sum them up, SET total-count to the result and DEL the list. Lua would be perfect for this but you can also .sh with redis-cli for example. What bothers ...


3

I would personally just do a backup for each database, and then attach them to the new server. Just remember to use EXEC sp_change_users_login 'Auto_Fix', 'username' for fixing user accounts. The Wizard approach sounds doable. I you need another approach for scripting DDL, the scptxfr.exe tool that comes with earlier version of SQL Server still works with ...


2

If you click on the 'Script' in the execute box that pops up from the delete button, it reveals that the script actually uses a DROP command: USE [DATABASE] GO /****** Object: Table [dbo].[TABLE] Script Date: 3/6/2014 9:29:39 AM ******/ DROP TABLE [dbo].[TABLE] GO


2

The spatial index, as with other objects, have their own script <object> as menus and need to be done separately. This can be done to the clipboard and pasted to the query window generated by the script table as command. I can't confirm at the moment, but I suspect that the primary key and other constraints come out in the script table as options ...


1

Let's say the new default you want is 5: DECLARE @sql NVARCHAR(MAX) = N''; SELECT @sql += N'ALTER TABLE ' + t + ' DROP CONSTRAINT ' + c + '; ALTER TABLE ' + t + ' ADD CONSTRAINT ' + c + ' DEFAULT (5) FOR [project_id];' FROM ( SELECT t = QUOTENAME(s.name) + '.' + QUOTENAME(t.name), c = QUOTENAME(d.name) FROM sys.tables AS t INNER JOIN ...


1

/****** Object: Database [DatabaseName] Script Date: 03/06/2014 10:32:06 AM ******/ DROP DATABASE [DatabaseName] GO However, you should probably just use the RESTORE DATABASE command and use the REPLACE option. REPLACE Specifies that SQL Server should create the specified database and its related files even if another database already exists with ...



Only top voted, non community-wiki answers of a minimum length are eligible