I'm getting message login failed user not associated with a trusted Sql Server Connection
It's a Sql Server 2005 legacy system with linked servers. Whoever set it up left sa password blank (I will be changing.)
How do make a trusted Sql Server connection ?
...
After a fair amount of research and some errors, I modified my code so that it creates a new DataContext each time the database is queried or data is inserted. And the database is queried frequently - for each of 250k transactions that are processed, the database is queried to obtain a customer id, department id, and category before the...
I wrote a stored procedure with optional parameters.
CREATE PROCEDURE dbo.GetActiveEmployee
@startTime DATETIME=NULL,
@endTime DATETIME=NULL
AS
SET NOCOUNT ON
SELECT columns
FROM table
WHERE (@startTime is NULL or table.StartTime >= @startTime) AND
(@endTIme is NULL or table.EndTime <= @endTime)
I'm won...
Hi,
Is there a an empty statement keyword in T-SQL in Sql Server 2005 or newer? Something like NULL statement in PL/SQL.
...
I'm trying to do a query that returns the information of a purchase bill, but also there's another table that has detail of the bill, but I need to add that total to the other query, but I can't add the column, because it says that I need to have in the group by the same objects that in the select, and I tried it this way, but it says th...
Hi guys,
We have a normalized SQL Server 2008 database designed using generic tables. So, instead of having a separate table for each entity (e.g. Products, Orders, OrderItems, etc), we have generic tables (Entities, Instances, Relationships, Attributes, etc).
We have decided to have a separate denormalized database for quick retrieva...
I'm using sql-server 2005 and ASP.NET C#.
i have Users table with userId(int),userGender(tinyint),userAge(tinyint),userCity(tinyint). (simplified version of course).
I need to select always two fit to userID i pass to query users of opposite gender, in age range of -5 to +10 years and from the same city.
Important fact is it always mu...
Hello gurus :)
We are developing a web application using asp.net and sql server. We are required to do an Audit trail for the application. As I understand this, an audit trail would basically be for all the Inserts, Updates and Deletes on the data base right? Now the way to approach this is that I have an Audit Trail Table in the DB tha...
Hello.
I have an assignment table in my database. I also have a assignment_notes table, which has a reference to the assignment table. There can exists multiple rows in this table.
When I select all my assignments, I want to check if there exists some notes to this assignment. And all I want is a true/false return.
Is it possible to d...
Hi there!
I wrote simple sql script that creates my database:
create database [MaterialStream];
exec sp_addlogin N'MaterialStreamLogin', N'123', N'MaterialStream'
exec sp_adduser N'MaterialStreamLogin', N'MaterialStreamUser', N'db_owner'
And then couldn't connect to my database from ADO.NET. How can I set up credentials for my user?
...
Hello Everyone,
I need to upload excel sheet in to the database. Which i am doing with the query
SELECT * INTO temp FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Dokumente und Einstellungen\l.varada\Desktop\BA-Control.xls',
'SELECT * FROM [qry_BA_Controlling (Report)$]')
Here C:\Dokumente und Einstellungen\l....
I am writing a stored procedure to handle the populating of a database from csv files. There about 150 tables and there will be 1 CSV file per table.
There is some added complication in that data needs to be validated against a validation table on import.
I am currently writing a single Store Procedure, that will take the csv file name...
hello..
i have a database table which contains some fields. one of the field's value is as like
,code,removeformat,undo,redo,cut,copy,color,|1|1,2,3,|0|500,400|1078,|False|500|
how can i insert "color" as shown using sql query this ?
i using sql server 2005,c#.
thank you
...
Hi, i'm using sql-server 2005 with asp.net C#.
There is a search query on my site with different parameters.
fromAge as tinyint
toAge as tinyint
fromHeight as tinyint
toHeight as tinyint
gender as tinyint
withImage as bit
region as tinyint
astrologicaSign as tinyint
these parameters i get from first time use performs a search and sa...
Hi,
I only know the basics of sql server like create tables, procedures etc. I want to know about table partitioning in sql server. i would like to get a tutorial which is really simple and easy to understand. i want to know about table partition, index partition ....
Please help.
...
I am using context_info to simulate a global variable, I use it in this context.
I have scripts made up of several batches, I set a global variable at the beginning (123 in the example) and then after all the batches I use that number to populate a log table.
Now this works, but today it failed on one machine, I cannot figure why. Is t...
I need to run a script like
EXEC sp_dbcmptlevel AdventureWorks, 100;
GO
Now I'd like to have a generic version that uses the database I am connected to, is it possible in T-SQL?
Something like this, but this doesn't work:
EXEC sp_dbcmptlevel DBNAME(), 100;
GO
It doesn't work of course because a string is returned, I'd like to have...
I have a ASP.NET MVC website in IIS 7 running against a SQL Server 2008 R2 database, in which I have a linked server set up. The linked server is set up so that a SQL account from my database is linked to a SQL account on the linked server.
All works fine until I recompile my website, and then it can't connect to the linked server anym...
I am trying to get the text elements of a table that follows a paragraph that contains a specific text element using XQuery on MS SQL Server. The problem is whenever I use the axes "following", "following-sibling" or "previous-sibling", I get an error saying this is not supported in SQL Server (I'm using version 2008). So for instance,...
I have been developing an application in Access 2003 that uses SQL Server as the back end data store. Access is used only as a GUI and does not store any data. All the code in the application is written in VBA using ADO for data access.
In recent meetings the DBA that works in my organization has become increasingly concerned over the f...