sql-server-express

Proper way to make a connection and query to a SQL Server Express database

断了今生、忘了曾经 提交于 2019-12-04 03:17:43
问题 I need a sample C# (console application) code witch connects to an SQL Server Express database and inserts a few variables into a table "laptops" SQL Server Express is @ localhost user name is database and password is testdatabase What is the proper way to do that ? 回答1: Basic ADO.NET 101: set up a connection set up a command to do something execute that command Step 1: setting up a connection You need to know the connection string to your database. Check out http://www.connectionstrings.com

How do I insert Chinese characters into a SQLExpress text field?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 02:59:22
How do I insert Chinese characters into a SQLExpress text field? I'm using SQL Express from VS 2008. When I add Chinese characters, either via an import app I wrote or by pasting them in from the data view inside Visual Studio, they end up as question marks. Just add an 'N' before your text delimiter in the INSERT/UPDATE statement for fields of the nchar/nvarchar/ntext type: INSERT INTO myTable (myField1, myField2) VALUES (N'any chinese character',N'any arabic character') Be sure you made your column type nchar, nvarchar or ntext. So you can store Unicode. It is all rather well described here.

SQL Dependency on SQL Server 2008 Express

时光毁灭记忆、已成空白 提交于 2019-12-03 20:57:53
I have an application which successfully uses SqlDependency with SQL Server 2008 Standard Edition. But if I switch the connection string to SQL Server 2008 express (with enabled Broker) it stops working. I'm not sure whether it is SQL Server Express specific, but which steps should I follow to find out the reason of the problem? Update. By "stops working" I mean notifications are not raised by SqlDependency Remus Rusanu To understand how SQL Dependency works I recommend you read The Mysterious Notification . To troubleshoot it follow the normal Troubleshooting Dialogs steps. The typical

How to export an entire Access database to SQL Server? [closed]

耗尽温柔 提交于 2019-12-03 17:03:04
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I've just got a lovely Access database, so the first thing I want to do is to move it over to a normal database management system (sqlexpress), but the only solution I've found sounds like craziness. Isn't there an " export database to .sql " button somewhere? I have around 50

Is there a way to stop SQL Express 2008 from Idling?

人走茶凉 提交于 2019-12-03 13:49:07
I am using SQL Express 2008 as a backend for a web application, the problem is the web application is used during business hours so sometimes during lunch or break time when there is no users logged in for a 20 minute period SQL express will kick into idle mode and free its cache. I am aware of this because it logs something like: Server resumed execution after being idle 9709 seconds or Starting up database 'xxxxxxx' in the event log I would like to avoid this idle behavior. Is there anyway to configure SQL express to stop idling or at least widen the time window to longer than 20mins? Or is

SQL Server 2008 Express Grant User Permission

做~自己de王妃 提交于 2019-12-03 09:45:41
问题 What is the appropriate SQL commands (not through the GUI) to add a windows user account to permissions on a SQL Server 2008 Database? ie.. I want to give someone read access and another person read/write.. 回答1: It's a two-step process: first, you need to create a login for that user, based on its Windows credentials CREATE LOGIN [<domainName>\<loginName>] FROM WINDOWS This sets up the basic permission to even connect to your SQL Server once you have a login, you can create a user in each

SqlServer 08: Query to list all databases in an instance?

寵の児 提交于 2019-12-03 09:36:23
How do I list all the databases for a given sql server 08 instance using sqlcmd? sqlcmd -E -S SERVER\INSTANCE -Q "sp_databases" EXEC sp_databases or SELECT NAME FROM sys.sysdatabases or EXEC sp_msForEachDB 'PRINT ''?'''; To elaborate with more detail for the sqlcmd newbie: C:\> sqlcmd -S <the_server_name> 1> select name from sys.databases 2> go You can use sp_databases stored procedure. 来源: https://stackoverflow.com/questions/2087902/sqlserver-08-query-to-list-all-databases-in-an-instance

SQL Server Management Studio - Adding/Moving Columns require drop and re-create?

╄→гoц情女王★ 提交于 2019-12-03 08:44:46
问题 Why do I get message that the table needs to dropped and re-created when I add/move columns? I believe this happens after adding foreign key constraints. What can I do to add new columns without dropping table? 回答1: If you're more interested in simply getting SSMS to stop nagging, you can uncheck the "Prevent saving changes that require table re-creation" setting in Options->Designers->Table And Database Designers. The table(s) will still be dropped and re-created, but at least SSMS won't

How to export an entire Access database to SQL Server? [closed]

眉间皱痕 提交于 2019-12-03 05:57:12
I've just got a lovely Access database, so the first thing I want to do is to move it over to a normal database management system (sqlexpress), but the only solution I've found sounds like craziness. Isn't there an " export database to .sql " button somewhere? I have around 50 tables and this export might run more than once so it would be great if I didn't have to export all the tables manually. Generating a .sql file (with tables creation and inserts) would also be great since it would allow me to keep that under version control. I guess if it's not possible to do something simple like this I

Create/restore database from backup SQL Server Express

泪湿孤枕 提交于 2019-12-03 05:43:47
问题 I don't have SQL Server Management Studio on my machine. I have a database backup (SQL Server 2008 R2). There is SQL Server Express that installed with Visual studio 2010 ultimate installed on my machine. How can I restore this back up on a database and attaching it to SQL Server Express? Is there any solution wihout using SQL Managment Studio Express ? 回答1: Even with SQL Server Management Studio Express, you won't be able to restore this backup. The Express edition being installed with