如何比较两个整数值与文本?(How to compare two integer values with text?)
HTML代码:
<li class="list-group-item ng-binding ng-scope" ng-repeat="sourceMatch in sourceMatches"> <img ng-src="/static/images/Timesjobs_small.jpg" width="32px" height="32px"> <span class="badge ng-binding">585784</span> Times Jobs </li>
我收到这个错误。
Expected '52675 Times Jobs' to match '52619 Times Jobs'.
它在第一行显示整数值,第二行显示文本,因此无法进行比较。 如何解决这个问题?
HTML code:
<li class="list-group-item ng-binding ng-scope" ng-repeat="sourceMatch in sourceMatches"> <img ng-src="/static/images/Timesjobs_small.jpg" width="32px" height="32px"> <span class="badge ng-binding">585784</span> Times Jobs </li>
I am getting this error.
Expected '52675 Times Jobs' to match '52619 Times Jobs'.
It is showing integer value in first line and text in second line so that am not able to compare. How to fix this?
原文:https://stackoverflow.com/questions/37131487
最满意答案
在Microsoft SQL Server Management Studio中,您可以右键单击要备份的数据库,然后单击“任务” - >“生成脚本”。
这将弹出一个向导,您可以在其中设置以下内容,以便对数据库执行体面的备份, 即使在远程服务器上也是如此 :
- 选择您要备份的数据库,然后点击下一步
- 在它给你的选项中:
- 在2010年:在表/视图选项下,将“脚本数据”和“脚本索引”更改为True,然后再次打开,
- 2012年:在“一般”下,将“数据类型到脚本”从“仅限模式”更改为“模式和数据”
- 2014年:在“设置脚本选项”的步骤中,现在将“数据脚本”选项“隐藏”,您必须单击“高级”并将“数据类型到脚本”设置为“架构和数据”值
- 在接下来的四个窗口中,点击“全选”,然后点击“
- 选择脚本到一个新的查询窗口
一旦完成它的事情,你将有一个备份脚本准备在你面前。 创建新的本地(或远程)数据库,并更改脚本中的第一个“USE”语句以使用新的数据库。 将脚本保存在安全的位置,然后继续运行,并将其运行到新的空数据库中。 这应该创建一个(几乎)重复的本地数据库,然后可以根据需要进行备份。
如果您有完全访问远程数据库,您可以选择在向导的第一个窗口中检查“脚本所有对象”,然后在下一个窗口中将“脚本数据库”选项更改为True。 请注意,您需要在脚本中执行完全搜索和替换数据库名称到新的数据库,在这种情况下,您不必在运行脚本之前创建。 这应该创建一个更准确的重复,但由于权限限制有时不可用。
In Microsoft SQL Server Management Studio you can right-click on the database you wish to backup and click Tasks -> Generate Scripts.
This pops open a wizard where you can set the following in order to perform a decent backup of your database, even on a remote server:
- Select the database you wish to backup and hit next,
- In the options it presents to you:
- In 2010: under the Table/View Options, change 'Script Data' and 'Script Indexes' to True and hit next,
- In 2012: under 'General', change 'Types of data to script' from 'Schema only' to 'Schema and data'
- In 2014: the option to script the data is now "hidden" in step "Set Scripting Options", you have to click the "Advanced" and set "Types of data to script" to "Schema and data" value
- In the next four windows, hit 'select all' and then next,
- Choose to script to a new query window
Once it's done its thing, you'll have a backup script ready in front of you. Create a new local (or remote) database, and change the first 'USE' statement in the script to use your new database. Save the script in a safe place, and go ahead and run it against your new empty database. This should create you a (nearly) duplicate local database you can then backup as you like.
If you have full access to the remote database, you can choose to check 'script all objects' in the wizard's first window and then change the 'Script Database' option to True on the next window. Watch out though, you'll need to perform a full search & replace of the database name in the script to a new database which in this case you won't have to create before running the script. This should create a more accurate duplicate but is sometimes not available due to permissions restrictions.
相关问答
更多-
让我们记住首先恢复的黄金法则。 '恢复完整数据库备份后,恢复最新的差异数据库备份和之后的所有事务日志备份,以使数据库进入当前状态。 因此,如果您只有一个完整备份,然后继续进行差异备份,那么差异备份的大小将每天不断增长。 如果发生灾难,您可能必须找到较旧的完整备份,然后恢复最新的差异备份。 理论上讲:如果您进行一次完整备份并转移到其他地方并继续进行差异备份工作。 但是,有些更改可能会导致完整备份损坏或差异备份出现问题。 在这种情况下,您将错过另一个完整备份。 定期进行完全备份始终是个好主意。 我每天都会在数据 ...
-
如何将远程SQL Server数据库备份到本地驱动器?(How can I backup a remote SQL Server database to a local drive?)[2022-06-18]
在Microsoft SQL Server Management Studio中,您可以右键单击要备份的数据库,然后单击“任务” - >“生成脚本”。 这将弹出一个向导,您可以在其中设置以下内容,以便对数据库执行体面的备份, 即使在远程服务器上也是如此 : 选择您要备份的数据库,然后点击下一步 在它给你的选项中: 在2010年:在表/视图选项下,将“脚本数据”和“脚本索引”更改为True,然后再次打开, 2012年:在“一般”下,将“数据类型到脚本”从“仅限模式”更改为“模式和数据” 2014年:在“设置脚 ... -
如何备份MySQL数据库?(How to backup a MySQL database?)[2022-03-02]
是的, MySQLdump mysqldump -u your-username -p database_name > filename Yes, MySQLdump mysqldump -u your-username -p database_name > filename -
SqlBackup是一种方法。 调用方法时,需要包括左括号和右括号: $backup.sqlbackup($server) 省略parens将输出方法签名而不是调用方法。 省略方法签名不是错误,因此没有错误。 SqlBackup is a method. When you call a method you need to include opening and closing parenthesis: $backup.sqlbackup($server) Omitting the parens wil ...
-
sqldumper.ruizata.com解决了我的问题。 sqldumper.ruizata.com solved my problem.
-
使用单个命令备份本地数据库并还原到远程服务器(Backup a local database and restore to remote server using single command)[2022-01-31]
您可能想要考虑使用mysql复制(使用1个主服务器和43个从服务器),而不是像您在此处描述的那样定期备份和还原。 复制将持续运行,因此43个从站将实时同步到主站。 有关详细信息,请参阅http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html 。 You might want to think about using mysql replication (with 1 master and 43 slaves), instead of back ... -
您可以创建数据库,然后将其配置为在外部驱动器上运行的文件 然后尝试恢复它。 在另一个文件夹中创建数据库示例: 在指定位置使用T SQL创建数据库 You can create database then configure it for files run on external drive. Then try to restore it. Creating db on another folder example here: Create a database using T SQL on a speci ...
-
你有几个选择来移动数据: 您可以使用Azure数据库迁移助理工具将数据从一个数据库迁移到另一个数据库。 您还可以将Azure Sql中的数据库导出到存储在Azure存储区域中的.bacpac文件。 查看此链接了解更多信息。 然后,您可以下载该文件并在本地SSMS中导入.bacpac文件。 作为参考,.bacpac文件是ZIP文件,其扩展名为'bacpac',包含来自SQL Server数据库的元数据和数据。 You got a few options to move the data: You can us ...
-
您可以使用SQL BACKUP DATABASE Foo TO DISK = '\\myserver\myshare\foo.bak' WITH INIT 确保用于sql服务的帐户有足够的权限写入其他pc。 因为映射的网络驱动器不会显示在您的用户帐户中。 这与在另一个用户帐户下运行的Sql Server 服务有关,然后是您用于映射驱动器的用户帐户。 You can by using SQL BACKUP DATABASE Foo TO DISK = '\\myserver\myshare\foo.bak' ...
-
您告诉Bugzilla如何连接到localconfig文件中的数据库服务器。 $db_driver = mysql # The DNS name of the host that the database server runs on. $db_host = localhost 我相信使用MySQL你也可以通过本地套接字直接连接。 请务必遵循Bugzilla安装说明来设置数据库,数据库用户和要使用的连接的密码。 表格将由Bugzilla的设置脚本自动设置。 You tell Bugzilla how to ...