Tag: .net

EXEC sp_spaceused query

I have a requirement to scrape 3 million documents. They are all text and varchar fields. For sample I just scraped 250 documents and when I ran EXEC sp_spaceused it gave me 26.6 MB as Database size. I want to know can we calculate the size required to store 3 million documents from this? Offcourse […]

open external files or applications from sql command using sql server

i want to open notepad, word or excel files from sql server using some query. is this possible? or is it possbile using C#.NET winform application. ? also, i want sql to use dll files present it my hard drive. how do i do both these tasks? please help me out with the code as […]

What SQL Server role do you pick for a normal user for ASP.NET Membership?

I used Integrated Security for a database connection for the first time for a website. The website pool uses Network Service as a user. I added Network Service as a SQL Server user mapped to public, then allowed it access to my database as websiteuser. There are many aspnet_… roles to choose from. Any links […]

Is it better to save upload file into SQL Server?

Possible Duplicate: store image in database or in a system file ? I am wondering if it is a better idea to save uploaded file into SQL Server. And if it is convenient to download the file stored in DB. If it works, what type of field should I use to store file? Any help […]

Entity Framework: Generated SQL – cannot find data type datetime2

So we migrated dev sql server to 2008. Our UAT sql server is still 2005. i had to regenerate my entity framework model for some other reasons, and upon deploying my work to UAT i noticed this error: cannot find data type datetime2 I profiled the database, and noticed that Entity Framework generated the input […]

Entity Framework 5 wrong data type in query

We are using EF 5.0 as our ORM of choice in our business solution, structured in a n-layer fashion with everything decoupled and a nice composition root with ninject. Lately, we’ve been building a database that uses partitioning underneath, and we have some important indexes on DATE columns. The columns are correctly declared on Sql […]

asp.net application, sql server & web services

I have no experience on connecting web apps to a SQL server on a different machine through web services. Are there standard web services that are supposed to be used? Also, why wouldn’t it be possible to connect to the SQL server on a “normal” way? EDIT: basically, I’m working on a new web application […]

Stopping .NET app's SQL Server DB being modifiable via Access using ODBC?

We have a .NET 2.0 winforms app that connects to a SQL Server 2005 database using Windows Authentication. All the database modifications are done using stored procedures which are called from the app. This works fine and users are only permitted to do things that their role permits. However, it has occurred to us that […]

using Enum in database and .net

this is how I declare enums: Enum GROUP_TYPE { TYPE1, TYPE2 } this is how I store them: GroupTypes(id, code) //code is the enum value name Groups(id, groupName, groupTypeId) In the InsertGroup stored procedure (I am using stored procedures) I receive @type_code as nvarchar and use it to find the correct id of the group […]

c# sql server backup percent read

sql command BACKUP DATABASE [databasesample] TO DISK = N’D:\kkk\test.bat’ WITH INIT , NOUNLOAD , NAME = N’name test’, NOSKIP , STATS = 5, DESCRIPTION = N’test’, NOFORMAT result 5 percent processed. 10 percent processed. 15 percent processed. 20 percent processed. 25 percent processed. 30 percent processed. 35 percent processed. 40 percent processed. 45 percent processed. […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.