sql-server

How can I create a user in SQL Server Express database I added to my project?

How can I create a SQL user in a SQL Server Express database that I added to my project? I need to create a user to use in a connection string that doesn't use Integrated Security. ...

call to stored procedure returns nothing

I am calling a stored procedure on sql server like this: SqlConnection conn = new SqlConnection(); SqlCommand cmd; XmlDocument xmlDocument; XmlReader xr; XmlNode node; SqlDataReader rdr = null; try { xmlDocument = new XmlDocument(); conn.ConnectionString = "Data Source=test;Initial Catalog=teste;Integrated Security=SSPI;"; ...

Deploying an application containing SQL Server database. Which authentication method?

I'm just a beginner in SQL Server database development and was wondering which authentication method to use. My database needs to have the simplest protection there is. If I choose Windows authentication, what username and password do I pass when connecting to the database? What will happen when another user installs the application on ...

Sql single index or multiple index

Let's say I have the Products table. On my UI, I allow the user to search by name, description, code The user can only search on criteria. Should I create an index for each criteria : name, description, code or create ONE single index for all 3? What will make you choose one versus the other? ...

How do I connect to a SQL Server database using WebMatrix?

I added a connection and it shows up in "Other Connections" but I can't seem to reference it. var db = Database.Open("MyNewConnection"); throws an exception: Connection string 'MyNewConnection' was not found. ...

getting an error with linq-to-sql on a table with a composite primary key

linq-to-sql is giving me this error "Can't perform Create, Update, or Delete operations on 'Table(Friend)' because it has no primary key." from a table with a composite primary key ...

rpc security information for publisher is missing

i use sql server 2008 for publisher and sql server 2005 express for subscriber , when i insert to a table from my subscriber this error occur : Msg 21079, Level 16, State 1, Procedure sp_getpublisherlink, Line 52 The RPC security information for the Publisher is missing or invalid. Use sp_link_publication to specify it. Msg 20512, L...

Since information_schema is a standard, where can i find the documentation of it?

Hi, Many databases has a information_schema database, since it is a standard. I want to know where can i find the documentation of it. Such as meaning of columns etc. Thanks. ...

Update statement fails because I have a column named order

I am trying to run an update statement as follows... UPDATE tblDeductionSystem SET [ORDER] = [0RDER] + 6 WHERE [ORDER] >= 7 AND ScoringCriteriaTypeID = @CheerDeductionScoreSheetID Sql Server if giving me invalid column name ORDER. I thought if I delimited the reserved word with the square brackets this would work. ...

sp_addsrvrolemember not granting login

According to MSDN documentation this proc is supposed to grant login to a windows user, but when i run the following script, I cannot login using the specified user even though the account shows up under security. exec sp_addsrvrolemember 'domain\user','dbcreator' also is there a way to query if a particular login can actually login t...

Visual Studio: How to get publish to provider to work for stored procedures?

When I click on Publish to Provider, I can't export my stored procedures. I get an error: " is an encrypted stored procedure. Scripting encrypted stored procedures is not supported". However, I have not encrypted any of my stored procedures, and this has always worked for me in the past, so I am guess something else is wrong. Here is...

Reconfigure TFS2008 + VS2010 after renaming Computer

Hi All, I had to rename a computer which was running TFS2008 with SQL2008 r2 on the same server.. Manage to get to connect SQL2008 R2 running with new name.. How can I re-configure the TFS to point to newly named ( NewServer\MyNamedSqlInstance) ?. ...

Connection string cannot be created

I'm developing a website in that, i couldn't create connection string ,i have included all the required namespaces but when i create a string variable to store the connection it wont come in declaring SqlConnection object, but i can able to create connection string in constructor class,why i can't able to create connection outside const...

optimising sql select statement

Is there a way to fetch 4 million records from SQL Server 2005 in under 60 seconds? My table consists of 15 columns. Each has datatype of varchar(100) and there is no primary key. ...

query for backup a database at another location in file system

BACKUP DATABASE <myDataBaseName> TO DISK = 'C:\PathtoBackup\FileName.bak' this query is worked for a database which is created in the gui of SQLServer express edition I have attached my database which is physically at D drive(D:\testing.mdf) to SQLServer using GUI in SQlServer Mgmt Studio.After attaching, SSMS displays the database na...

To Create SQL Report, Should i Include Aggregate Functions in SQL Query or Do it via Reporting Tools?

While learning about creating MS SQL Reporting and deploying reports to SQL Reporting Server, i found that there is no need to worry about creating a query that involves sorting, grouping and so on. All i need to do is fetch the columns and data i need from various tables and then once the data loads in dataset, i can use the GUI tools t...

Parse all stored procedures in a database

Does anyone know of a way to verify the correctness of the queries in all stored procedures in a database? I'm thinking of the scenario where if you modify something in a code file, simply doing a rebuild would show you compilation errors that point you to places where you need to fix things. In a database scenario, say if you modify a t...

Updating SQL Table In Enterprise Manager - Foreign Key Issues

I have a table with a whole bunch of FKs. Table Vehicles ----------- ColorID -> Color.ID MakeID -> Make.ID ModelID -> Model.ID etc... My issue is that I forgot a few columns and I need to add them. I can add them through right clicking on the table and choosing 'Design', but not if I want to make them NOT NULL, or delete a column. I...

TSQL Finding Order that occurred in 3 consecutive months

Please help me to generate the following query. Say I have customer table and order table. Customer Table CustID CustName 1 AA 2 BB 3 CC 4 DD Order Table OrderID OrderDate CustID 100 01-JAN-2000 1 101 05-FEB-2000 1 102 10-MAR-2000 1 103 01-NOV-20...

How much network knowledge does a SQL Server DBA need to have to do their daily work?

How much network knowledge does a SQL Server DBA need to have in order to do their daily work? Are their any good resources to recommend? (websites, books, blogs etc) ...