Quantcast
Channel: SQL Server Express forum
Viewing all 3319 articles
Browse latest View live

Synchronization between 2 MS SQL express

$
0
0

Hi there,

I am new to MS SQL and not sure if there is a simple way to re-sync database between 2 MS SQL DB.

for example, SQL A and SQL B are in the same local network.

I would like

1)SQL A update to SQL B when there is a data updated on SQL A

2)SQL B update to SQL A when there is a data updated on SQL B

is there any simple setting can be done for this function on SQL server?

thanks.


How can I add cumulative sum column?

$
0
0

I use SqlExpress

Following is the query using which I get the attached result.

SELECT ReceiptId, Date, Amount, Fine, [Transaction]
FROM (
    SELECT ReceiptId, Date, Amount, 'DR' AS [Transaction]
    FROM ReceiptCRDR
    WHERE        (Amount > 0)

    UNION ALL

    SELECT        ReceiptId, Date, Amount, 'CR' AS [Transaction]
    FROM            ReceiptCR
    WHERE        (Amount > 0)

    UNION ALL

    SELECT        strInvoiceNo AS ReceiptId, CONVERT(datetime, dtInvoiceDt, 103) AS Date, floatTotal AS Amount,  'DR' AS [Transaction]
    FROM            tblSellDetails
) AS t
ORDER BY Date

Result of the above query 

want a new column which would show balance amount. For example. 1 Row should show -2500, 2nd should -3900, 3rd should -700 and so on.

basically, it requires previous row' Account column's data and carry out calculation based on transaction type.

Sample Result


markand

MS SQL Server Express edition

$
0
0

Hi There

Please  advise what is the limitation in having SQL Express edition running on the server.

I know you cannot have more than 4 cores and still use express edition on the server, when the cores are more than 4/1 socket you must load a licensable software. I am struggling to find this information and I am busy trying to finish a SQL Workload exercise.

Please help urgently.

Regards

Sekiwe

EncryptByAsymKey fails if input is too long

$
0
0

EncryptByAsymKey returns NULL if input exceeds a certain amount of length(26 Characters).I am using  512 bit RSA key for encryption. encryption

returns NULL value in both SQL Server 2008 R2 and SQL Server 2012 . In this link "https://connect.microsoft.com/SQLServer/feedback/details/735926/topic-for-encryptbyasymkey-fails-to-mention-that-return-value-may-be-null-if-input-is-too-long"

but still it is not fixed.


Using Visual Studio 2015 to deploy SSIS Packages to SQL Server 2012?

$
0
0

For some time I've been using the MS SQL Server Data Tools which installs a Visual Studio 2012 Shell to create and deploy packages.  I have pro versions of Visual Studio 2013 and 2015 on the same machine for other projects.  I've been under the impression that I cannot use them to target SQL 2012 as they are only able to deploy to SQL 2014 and 2016.  

Is this correct or can I using these newer tools to develop for SQL 2012 and ditch the older Data Tools?

Thanks,

Scott


SQL Table merge

$
0
0

Hi, 

I'd like to find the way to combine 4 tables in SQL database.

Table 1 ~ 4 contains the sames columns, (25 columns), each tables contains more than 40,000 rows.

Table 1 is Q1, Table 2 is Q2, ...and so on and I want a table for a complete year by combining all 4 tables.

Could you please guide me how to do so ?

I tried using "join...On ", but did not work, since i just want to merge the tables vertically, not horisontally.

Thank you!

Express 2016 with Advanced Options

$
0
0

Is Express 2016 with advanced options, the install page suggests that the installer should provide install options but it doesn't, and the express 2016 product page lists 'with advanced options' as an available install option.

Any suggestions?


Before installing SQL Server 2016 Express Edition

$
0
0

I currently have SQL Server 2014 express edition installed.

1) Do I have to uninstall 2014 first

2) Is there a new SSRS version as well

3) If not, If I install the 2016 version, do I then have to reinstall SSRS?


Microsoft Visual Studio Shell Isolated cannot find one or more components

$
0
0

Hi Team,

I got an error while opening SQL management studio 2012.
Microsoft Visual Studio Shell Isolated cannot find one or more components.
I also have SQL server 2014 installed in the same pc.
The same issue happens for that too.
Kindly someone help me fixing this issue.



Best Regards,
Arun.


Windows Service can't start localDb process

$
0
0

Hello,

I created a named and shared instance of localDb and want to connect from a Windows service to the database. A sql login is defined and added to my connection string. The connection works fine if the process is runnning, but I can't connect when it is stopped.

Data Source=(localdb)\.\MySharedLocalDB;Integrated Security=false;User Id=test;Password=***;Initial Catalog=myDB

Therefore my next try was to connection with Windows Authentication, I added NT AUTHORITY\SYSTEM as sql login and adapted my connection string without success.

Data Source=(localdb)\.\MySharedLocalDB;Integrated Security=true

Both users are sysadmin, public and login is mapped with database as dbowner.

What is wrong and how can I start automatically the process with my service?

Thanks

Regards


Retrieve data from stored procedure which has multiple result sets and insert into multiple tables

$
0
0

Hi All,

I have a scenario where my stored procedure reruns multiple record sets (eg RecordSet1, RecordSet2).

I want to insert those record set into different tables (Eg Table1, Table2).

So always RecordSet1 will be inserted to Table1 and RecordSet2 will be inserted to Table2.

Is there any way to do this?

Regards,

Amit

SSE 2014 Install Fail - SQLWriter

$
0
0

Computer Win 10 32-bit.  I installed SSE 2014 when Win 7, upgraded to Win 10, uninstalled and am trying to reinstall.

I get a failure when trying to install SSE 2014 - 32-bit. I have done this twice and same results.  Any help resolving this appreciated.

It says cannot find service {0} Parameter name: SQLWriter.

SQLWriter was installed correctly.

These are the steps I have taken:

1.  Ran MS Uninstaller/Installer numerous times getting rid of all traces of SQL Server.

2.  Cleaned registry of all traces of SQL Server.

3.  Deleted SQL SERVER directory in program files.

The log file shows this (links aren't valid).  I don't see any trace of Database Engine Services or SQL Server Replication to uninstall.

Detailed results:
  Feature:                       Database Engine Services
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred during the setup process of the feature.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          87
  Error description:             Cannot find service {0}.  Parameter name: SQLWriter
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xD5300D50%400x6AD84D9E&EvtType=0xD5300D50%400x6AD84D9E

  Feature:                       SQL Server Replication
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          87
  Error description:             Cannot find service {0}.  Parameter name: SQLWriter
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xD5300D50%400x6AD84D9E&EvtType=0xD5300D50%400x6AD84D9E

  Feature:                       SQL Browser
  Status:                        Passed

  Feature:                       Setup Support Files
  Status:                        Passed

  Feature:                       SQL Writer
  Status:                        Passed

Querying 4-character Year in a SQL nvarchar date column

$
0
0

I have a SQL Server 2008 R2 EXPRESS database in a C# 4.0 App.
In my database I have a table, i.e. table1 containing a nvarchar(35) column, where I write date values in the format MMM-d-yyyy. This table contains values such as 'May-1-2015', 'Jun-12-2015', and will also contain dates from the current 2016 year among others.
I also have a History table, i.e. table2, where at the end of each year, I need to insert values from table1 into table2, but only from the previous year, i.e. '2015'.

I have written a method to insert selected fields from table1 into table2, but need to pass a variable in my SELECT statement specifying the previous year date.
The following is merely pseudo-code demonstrating what I'm attempting to do.
The problem I'm running into, is how to specify the year in my select statement.

private void CopyToHistoryTable()
{
    int curYear = DateTime.UtcNow.Year - 1;
    string year = curYear.ToString();

    try
    {
	using (SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myDatabase.mdf;Integrated Security=True;User Instance=True"))
	{
	    conn.Open();
	    {
		using (SqlCommand cmdCopy = new SqlCommand("INSERT INTO table2 (company, person, myDate)" +"SELECT company, person, myDate FROM table1 WHERE myDate LIKE '" + year + "'", conn))
	        {
		    int response = cmdCopy.ExecuteNonQuery();
		    if (response > 0)
		    {
		        MessageBox.Show("Data has been moved into the History DB!");
		    }
		}
	    }
	}
    }
    catch (SqlException ex) { MessageBox.Show(ex.Message); }
    catch (System.Exception ex) { MessageBox.Show(ex.Message); }
}
I've tried the above approach, but the integer variable "response" is always 0 zero.
I've also tried a parameterized approach, i.e. WHERE myDate LIKE @Year... with the following: cmdCopy.Parameters.Add("@Year", SqlDbType.NVarChar).Value = year;
However, the result is the same when I execute the query.
I even attempted to use DATEPART(Year, myDate) but can't quite get that correct. All the examples I saw online had the date hard-coded, i.e. SELECT DATEPART(yyyy, '2014/04/28');

Please suggest how I can pass the string variable "year" to my SQL Query, as I will only be pulling the previous year from table1 and cannot hard-code a date in my query, as this will change with each new year.
I'm not sure if I will need to use a SqlDataReader to iterate through the rows or not.

Error SQL Server 2012 Installation

$
0
0

i have this issue when running SQL 2012/2014 setup on a new server. The setup will proceed to install Setup support files, the window will disappear and show an error without error message 

and here is the sql setup log

06/27/2016 14:46:40.628 ======================================================================
06/27/2016 14:46:40.646 Setup launched
06/27/2016 14:46:40.671 Attempting to determine media source
06/27/2016 14:46:40.694 Media source value not specified on command line argument.
06/27/2016 14:46:40.716 Setup is launched from media directly so default the value to the current folder.
06/27/2016 14:46:40.738 Media source: I:\en_SQL Server 2014 Express SP1\
06/27/2016 14:46:40.760 Attempt to determine media layout based on file 'I:\en_SQL Server 2014 Express SP1\mediainfo.xml'.
06/27/2016 14:46:40.803 Media layout is detected as: Advanced
06/27/2016 14:46:40.826 Media is a slipstream package
06/27/2016 14:46:40.849 Only patch related actions can run patch setup.exe, so continuing to run setup.exe from media.
06/27/2016 14:46:40.888 /? or /HELP or /ACTION=HELP specified: false
06/27/2016 14:46:40.901 Help display: false
06/27/2016 14:46:40.925 .Net version 3.5 is installed
06/27/2016 14:46:40.948 .Net version 2.0 is installed
06/27/2016 14:46:40.970 Current running setup.exe full path: I:\en_SQL Server 2014 Express SP1\SETUP.EXE
06/27/2016 14:46:40.993 Media setup.exe file version detected: 2014.120.4100.1
06/27/2016 14:46:41.013 Locally installed setup.exe full path: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\SQLServer2014\setup.exe
06/27/2016 14:46:41.037 Local setup.exe file version detected: 2014.120.4100.1
06/27/2016 14:46:41.058 Local setup.exe version 2014.120.4100.1 is equal or greater than media version 2014.120.4100.1, so re-launching setup.exe from local
06/27/2016 14:46:41.081 Media source: I:\en_SQL Server 2014 Express SP1\
06/27/2016 14:46:41.103 Install media path: I:\en_SQL Server 2014 Express SP1\x64\setup\
06/27/2016 14:46:41.126 Media layout: Advanced
06/27/2016 14:46:41.147 Attempting to get execution timestamp
06/27/2016 14:46:41.170 Timestamp: 20160627_144640
06/27/2016 14:46:41.192 Attempting to launch local setup.exe
06/27/2016 14:46:41.214 Attempting to launch process C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\SQLServer2014\setup.exe
06/27/2016 14:46:42.163 Process returned exit code: 0x84C4003206/27/2016 14:46:42.219 Local setup.exe returned exit code: 0x84C40032
06/27/2016 14:46:42.243 Setup closed with exit code: 0x84C40013
06/27/2016 14:46:42.265 ======================================================================


Cosmetic Question

$
0
0

Hi

I would like to ask why does it say query 'executed' successfully when I have 'parsed' a query? I think it should say successfully 'parsed' - not successfully 'executed' - as nothing is being executed. We are only 'parsing'? Please advise.

Thanks

Uma



Problem saving a date to a date field

$
0
0

Hi all,

I have a textbox and enter a date in it (European format). B.e. 14-07-2016.

I'm converting this string to a date like:

Dim Conv_Date=Date.Parse(TextBox1.Text).ToShortDateString

And I want to save it to my database like:

cmd.CommandText = "insert into proj ([Datum_concept]) Values ('"& Conv_Date& "')"

cmd.ExecuteNonQuery()

I get an error message like:

Conversion failed when converting date and/or time from character string.

I don't know what I'm doing wrong. The [Datum_concept] field is just a date field.

Any ideas?

regards,

Mark

Upgrade from SQL 2008 R2 Express to SQL 2008 Standard with SQL 2012 Standard license

$
0
0

I have to upgrade from SQL 2008 R2 Express to SQL 2008 Standard, but I can't buy anymore licenses for 2008 but is still possible to buy SQL 2012 license. The main question, is it possible to do an license upgrade to run SQL 2008 Standard with 2012 license?

Any help would be appreciated.


sa locked and BUILIN\Administrator account disable

$
0
0
Dear Team 

Need your assistance currently I have a problem to access SQL Server using sa due account locked and BUILIN\Adminsitrator was disable during database hardening. So i cant access using Windows Authentication . 
I have few step such as login as single user mode and create new user ID with sysadmin prvilages. But still not work . 
Need your assistance and help, is it any other way or step that i can use to unlocked sa and access into sql database environment 

Really appreciate your kind assistance 

SQL SERVER VERSION : MSSQL 2012 Express Edt
OS SYSTEM : Windows Server 2008 Standard Edt

Thank you 
Amy Badri

XACT_E_CONNECTION_DOWN

$
0
0
Hi please could you tell me if this hot fix https://support.microsoft.com/en-us/kb/3024331 was already applied on sql server 2012 sp3

SQLSERVER EXPRESS 2008R2 - string not showing when trying to connect

$
0
0

installed SQLxpress08R2 on a Win7 box in a domain. When trying to setup an ODBC connection on other W7 workstations with either SQLclient version 6 or SQL Native Client10, the machine name of W7 shows up in the dropdown list of available servers but without the "\SQLSERVEREXPRESS2008R2" as part of the name. The pc's are unable to connect to the SQL, getting errors 08001.

What setting am I missing on the Win7box with the SQL installed on?


TechNet

Viewing all 3319 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>