SQL Server Problems and Questions from an SQL dummy

I am an SQL Dummy!

In the old 2008 version of SQL I had to run a script to fix a rounding error in my Microsoft Accounting software (no longer supported)  I think I have version 10 now?

 

SQL FIX for Fiscal Year won't close


 

Need to use Sql Management Studio (as oppose to more obscure osql.exe)

to run sql script

b) Use Sql Management Studio to execute script below:

SELECT *

FROM dbo.CashPostingTable

WHERE (amountcredit <> amountCreditCompanyCurrency OR amountDebit <>

amountDebitCompanyCurrency) AND exchangeRate=100

If you get any rows/data back, proceed to step c), if no result, a more

serious problem - good lucks or buy help.

c) Use Sql Management Studio to execute script below:

UPDATE cashpostingtable

SET amountCreditCompanyCurrency = amountCredit,

amountDebitCompanyCurrency = amountDebit,

companyAmountRemainder = accountAmountRemainder

WHERE (amountcredit <> amountCreditCompanyCurrency OR amountDebit <>

amountDebitCompanyCurrency) AND exchangeRate=100

Management Studio no longer works.  Is there a way to do the same thing in the version I have?

Thank you,

Dean

January 31st, 2015 9:40pm

 I am an SQL Dummy!

In the old 2008 version of SQL I had to run a script to fix a rounding error in my Microsoft Accounting software (no longer supported)  I think I have version 10 now?

 

SQL FIX for Fiscal Year won't close

Need to use Sql Management Studio (as oppose to more obscure osql.exe)

to run sql script

b) Use Sql Management Studio to execute script below:

SELECT *

FROM dbo.CashPostingTable

WHERE (amountcredit <> amountCreditCompanyCurrency OR amountDebit <>

amountDebitCompanyCurrency) AND exchangeRate=100

If you get any rows/data back, proceed to step c), if no result, a more

serious problem - good lucks or buy help.

c) Use Sql Management Studio to execute script below:

UPDATE cashpostingtable

SET amountCreditCompanyCurrency = amountCredit,

amountDebitCompanyCurrency = amountDebit,

companyAmountRemainder = accountAmountRemainder

WHERE (amountcredit <> amountCreditCompanyCurrency OR amountDebit <>

amountDebitCompanyCurrency) AND exchangeRate=100

Management Studio no longer works.  Is there a way to do the same thing in the version I have?

Thank you,

Dean

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 11:53pm

1.  Sorry

2. I think version 2012.  I don't know where / how to run select@@version

3. I am not able to load Management studio. I also have

4.  No error message I just can't find it.  Looked at Microsoft info on web and it says run

I tried the OSQL command as shown below and I can't get that to work either.

When I run osql I get a long message about osql not supporting all features of SQL server 2008 use sqlcmd instead.

When I run sqlcmd -i C:\Program Files (x86)\Microsoft SQL Server\MSSQL10.MSSMLBIZ\MSSQL\Data\classicboatworks61.sbd

I get an invalid filename message.

I want to run this script:

UPDATE cashpostingtable

SET amountCreditCompanyCurrency = amountCredit,

amountDebitCompanyCurrency = amountDebit,

companyAmountRemainder = accountAmountRemainder

WHERE (amountcredit <> amountCreditCompanyCurrency OR amountDebit <>

amountDebitCompanyCurrency) AND exchangeRate=100

which fixes a rounding error and allows me to close my Fiscal Year.

February 1st, 2015 4:05pm

3. I have visual studio installed but it does not show on my Start / Programs list

4. Microsoft says run "set up" to add Management Studio (does not show on program list) but couldn't make that work either

4. run: sqlcmd -i C:\\Program Files (x86)\Microsoft SQL Server\MSSQL10.MSSMLBIZ\MSSQL\Data\classicboatworks61.sbd

"Invalid Filename"

Free Windows Admin Tool Kit Click here and download it now
February 1st, 2015 4:30pm

You can download SQL Server Management Studio from this link:
http://www.microsoft.com/en-us/download/details.aspx?id=43351

You should select one of the SQLManagementStudio files.

February 1st, 2015 5:15pm

It is likely that you have an installation of SQL which has not been installed with Management Studio. If you want the to install management studio then you can download it from the following links.

Microsoft SQL Server 2008 R2 SP2 - Express Edition
http://www.microsoft.com/en-gb/download/details.aspx?id=30438

Microsoft SQL Server 2012 Service Pack 2 (SP2) Express
http://www.microsoft.com/en-gb/download/details.aspx?id=43351

Microsoft SQL Server 2014 Express
http://www.microsoft.com/en-gb/download/details.aspx?id=42299

It is likely that you will need the 64 bit version.

32BIT SQLManagementStudio_x86_ENU.exe
64BIT SQLManagementStudio_x64_ENU.exe

Based on your file path and you stating version 10, then the most probable installation you have is SQL 2008 Express. The tools are backward compatible and so you are free to pick any of the above versions.

If you want to check your version:

SQLCMD  -Q "SELECT @@VERSION"

As to running your script, you do not need to have a gui and obviously could use SQLCMD. I note that the path posted has spaces so will need to be quoted. As well as this it starts C:\\


Before running the script browse to the directory and check that you are happy with the content of the file you are about to run.

SQLCMD -i "C:\Program Files (x86)\Microsoft SQL Server\MSSQL10.MSSMLBIZ\MSSQL\Data\classicboatworks61.sbd"


Free Windows Admin Tool Kit Click here and download it now
February 1st, 2015 5:49pm

SQLCMD -Q "SELECT @@VERSION"

Judging from the path that Dean posted, this should probably be

SQLCMD -S .\MSSMLBIZ -Q"SELECT @@version"
February 1st, 2015 6:04pm

Success!

Thank you All...

I finally got SQL Management Studio installed then followed the directions of how to run a script found here: https://hiskb.healthcois.com/KnowledgebaseArticle10340.aspx

Once I ran the script the data base is fixed and working properly.

Thanks again, I could not have done this without your help.

Dean

Free Windows Admin Tool Kit Click here and download it now
February 1st, 2015 8:42pm

SQLCMD -Q "SELECT @@VERSION"

Judging from the path that Dean posted, this should probably be

SQLCMD -S .\MSSMLBIZ -Q"SELECT @@version"
February 2nd, 2015 3:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics