Change SQL Server 2005 Server Collation - sql-server-2005

I need to set up an instance of SQL Server 2005 with SQL_Latin1_General_CP850_Bin as the server collation (the vendor did not take into accounting looking at DB collation for a bunch of things so stored procedures and temp tables default to the server level and the default collation will not work). During the install for SQL Server it did not give that as an option so I left it at default and finished installing it.
According to MSDN and Technet I should need to just run the following command:
setup.exe /q /ACTION=RebuildDatabase /INSTANCENAME=MSSQLSERVER /SAPWD="sa-pwd" /SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS" /SqlCollation=SQL_Latin1_General_CP1_CI_AI
However, whenever I run the above command with my parameters I get the pop-up of the SQL Server installation wizard, accept the agreement, and then it gives me output stating how to use the command.
Any idea what I can do?

I think you're looking at instructions for SQL Server 2008.
See the article here for instructions for 2005.

If possible, I would uninstall and reinstall rather than trying to change it. Changing it without re-installing is not a simple process. To change from the default during install, just uncheck the "Hide advanced configuration options" check box on the Registration Information screen; doing that will give you a Collation Settings option about 4 screens later in the install.

Related

SQL Schema Compare from one SQL version to another not working

In Visual Studio (2013 or 2015, they both do the same) > SQL Schema Compare, I am trying to copy the schema from one database on sql 2008, to databases on sql 2014. From 2008 -> 2008 works fine, 2014->2014 works fine, but when trying to go from 2008->2014, it does not work. After running the compare and hitting update it just sits on "Schema Compare generate script (db1 > db2) until it eventually freezes and visual studio just says it is busy, and never finishes. I can not find a log that explains what point it gets stuck on either.
Under options I have tried to ignore compatibility issues but this does not fix it. Any suggestions?
That might be a schema compare bug. I'd suggest first ensuring that you're using the latest version of the SQL Server tools (available for download here: https://msdn.microsoft.com/en-us/library/mt204009.aspx)
Then, if the problem still persists, I'd suggest capturing a trace log using the below instructions and opening a Connect issue that describes the problem and includes the trace log at https://connect.microsoft.com/SQLServer/feedback/CreateFeedback.aspx using the category "Developer Tools (SSDT, BIDS, etc.)"
Gathering an Event Log for SSDT
Open a new command prompt as Administrator.
Run this command logman create trace -n DacFxDebug -p "Microsoft-SQLServerDataTools" 0x800 -o "%LOCALAPPDATA%\DacFxDebug.etl" -ets
Then run this command: logman create trace -n SSDTDebug -p "Microsoft-SQLServerDataToolsVS" 0x800 -o "%LOCALAPPDATA%\SSDTDebug.etl" -ets
Run SSDT and reproduce the issue.
Go back to the command prompt and run the following commands:
logman stop DacFxDebug -ets
logman stop SSDTDebug -ets
The resulting ETL files will be located at %LOCALAPPDATA%\SSDTDebug.etl & %LOCALAPPDATA%\DacFxDebug.etl.
Instead of hitting "Update" try "Generate Script", and then run the script on the destination database.

Alternatives to sqlcmd/best practice

I have created a sql query that updates certain tables taking a CSV file as the input.
I want my co-workers to be able to execute this query as easily as possible. At first, I thought a batch file using sqlcmd was the best solution.
The end product works on my computer, because I have SSMS installed, but no other computer is able to properly launch the batch file.
What is the best way for my end-users to run an sql query? I have thought/researched these solutions:
-Install SSMS or the required tools(don't want each user to have to do this.)
-Install Psexec tools to allow for remote batch launching (also don't like this.)
Is there a better way?
Check SQLS*Plus from www.memfix.com - works the best.
Why don't you create a C-Sharp or VB.Net program that executes the proc and distribute the program to your users?
You don't have to install all of SMS. You can just install SQLServer2008CmdLnUtilsx86.msi for SQL 2008 or go here to get SQLCMD for SQL 2012. http://www.microsoft.com/en-us/download/details.aspx?id=36433. Just be aware that if you install SQLCMD in a bat file and then attempt to use SQLCMD after installing it in that same bat file you have to specify full path to SQLCMD because PATH value is loaded at time bat was started and SQLCMD was not yet available at that time.

SQL Server 2012 installation Reporting Services Catalog error

I'm installing SQL Server 2012 at the moment and when I was about to run the installation, this error pops up:
On clicking the first failed test, which is "Reporting Services Catalog Database File Existence", this is what i get:
On clicking the second failed test, which is "Reporting Services Catalog Temporary Database File Existence", this is what i get:
So basically, both of the message box says me that "Catalog Database File" & "Catalog Temporary database files exists". Because of this, i need to select Reporting Services file-only mode installation.
My questions are:
How do i select file-only mode installation?
Do i've to close the setup and do something and afterwards run the setup again?
Btw, I had SQL Server 2012 installed before. I uninstalled it completely due to some strange errors and decided to reinstall a fresh copy of SQL Server 2012 and now I'm stuck with these errors. Any help will be sincerely appreciated. :)
Since you already had one installation of SQL Server done before, there was a database already created. That did not get removed. So when you reinstall, its trying to create the database with the same name, hence, the error. You need to delete the old files to continue the new installation.
From the direcotry
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA
Remove the following files
ReportServer.mdf
ReportServer_log.LDF
ReportServerTempDB.mdf
ReportServerTempDB_log.LDF
Try the Following link for further help.
Reporting Services Catalog Error.
For sql-server-2012 the path is:
C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQL2012\MSSQL\DATA
where MSSQL2012 is the instance name and the respective file names are:
ReportServer$MSSQL2012.mdf
ReportServer$MSSQL2012_log.mdf
ReportServer$MSSQL2012TempDB.mdf
ReportServer$MSSQL2012TempDB_log.mdf
Remove the following files from the C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA directory:
bulletReportServer.mdf
bulletReportServer_log.LDF
bulletReportServerTempDB.mdf
bulletReportServerTempDB_log.LDF.
This happens if you reinstall SQL Server and these files weren't deleted.

How can I execute SQL scripts using TeamCity?

I´m new with TeamCity and I don´t know how to run SQL scripts with it.
Is the way simply selecting the path of those scripts in a Command Line Build Runner ?
I´m pretty lost.
Regards.
In a command line build step:
Command executable: c:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exe
Command parameters: -S <server> -i <path_to_file> <== Note: that's a capital -S!
You may need to change the 100 to something else, depending on the version of the SQL Server tools that you have installed on the build agent.
I believe that SQLCMD / SQLPLUS / MYSQL are available as standalone executables which you can install on the TeamCity server.
Microsoft® SQL Server® 2008 R2 Feature Pack
Oracle SQL Plus
MYSQL Command Line
However, without knowing your actual SQL Platform this may differ and the provider should have an alternative.
You can then create a Command Line Runner to call the executeable and pass in the parameters required, which are further explained here.
Using the sqlcmd Utility
Using sqlplus utility
If you are looking at doing Database Migrations as part of your CI process, it would also be worth checking out RoundhousE

Use tnsnames.ora in Oracle SQL Developer

I am evaluating Oracle SQL Developer.
My tnsnames.ora is populated, and a tnsping to a connection defined in tnsnames.ora works fine. Still, SQL Developer does not display any connections.
Oracle SQL Developer Soars mentions, that if
you have Oracle client software and a tnsnames.ora file already installed on your machine, Oracle SQL Developer will automatically populate the Connections navigator from the net service names defined in tnsnames.ora.
I also tried to set my TNS_ADMIN environment variable, but after restarting SQL Developer there are still no connections displayed.
Any ideas?
Anyone successfully working with SQL Developer and tnsnames.ora?
In SQLDeveloper browse Tools --> Preferences, as shown in below image.
In the Preferences options expand Database --> select Advanced --> under "Tnsnames Directory" --> Browse the directory where tnsnames.ora present.
Then click on Ok,
as shown in below diagram.
tnsnames.ora available at Drive:\oracle\product\10x.x.x\client_x\NETWORK\ADMIN
Now you can connect via the TNSnames options.
This excellent answer to a similar question (that I could not find before, unfortunately) helped me solve the problem.
Copying Content from referenced answer :
SQL Developer will look in the following location in this order for a tnsnames.ora file
$HOME/.tnsnames.ora
$TNS_ADMIN/tnsnames.ora
TNS_ADMIN lookup key in the registry
/etc/tnsnames.ora ( non-windows )
$ORACLE_HOME/network/admin/tnsnames.ora
LocalMachine\SOFTWARE\ORACLE\ORACLE_HOME_KEY
LocalMachine\SOFTWARE\ORACLE\ORACLE_HOME
If your tnsnames.ora file is not getting recognized, use the following procedure:
Define an environmental variable called TNS_ADMIN to point to the folder that contains your tnsnames.ora file.
In Windows, this is done by navigating to Control Panel > System > Advanced system settings > Environment Variables...
In Linux, define the TNS_ADMIN variable in the .profile file in your home directory.
Confirm the os is recognizing this environmental variable
From the Windows command line: echo %TNS_ADMIN%
From linux: echo $TNS_ADMIN
Restart SQL Developer
Now in SQL Developer right click on Connections and select New Connection.... Select TNS as connection type in the drop down box. Your entries from tnsnames.ora should now display here.
I had the same problem, tnsnames.ora worked fine for all other tools but SQL Developer would not use it. I tried all the suggestions on the web I could find, including the solutions on the link provided here.
Nothing worked.
It turns out that the database was caching backup copies of tnsnames.ora like tnsnames.ora.bk2, tnsnames09042811AM4501.bak, tnsnames.ora.bk etc. These files were not readable by the average user.
I suspect sqldeveloper is pattern matching for the name and it was trying to read one of these backup copies and couldn't. So it just fails gracefully and shows nothing in drop down list.
The solution is to make all the files readable or delete or move the backup copies out of the Admin directory.
This helped me:
Posted: 8/12/2011 4:54
Set tnsnames directory
tools->Preferences->Database->advanced->Tnsnames Directory
https://forums.oracle.com/forums/thread.jspa?messageID=10020012&#10020012
On the newer versions of macOS, one also has to set java.library.path. The easiest/safest way to do that [1] is by creating ~/.sqldeveloper/<version>/sqldeveloper.conf file and populating it as such:
AddVMOption -Djava.library.path=<instant client directory>
[1] https://community.oracle.com/message/14132189#14132189