sql-server

SQL Server

hi guys i took a database snapshot .Then if i make a changes then that changes will reflect the base database or snapshot database? When i take a database snapshot does it create a another database? ...

Options to Replicate Microsoft SQL Server Database to MySQL/PostgreSQL on Linux

I need to replicate data from Microsoft SQL Server to MySQL or PostgreSQL. The data includes images stored in BLOB columns. Could you please comment on your experiences with the following strategies and suggest others I may have missing? custom script written in Java using JDBC linux odbc driver with perl script Setup my own windows ...

i need to get alldata whereclause in sql?

i need to take all data if Page!=@page, get AllDATA select count(page) as TARIH, (datepart(hour,Date)*60+datepart(minute,Date))/@countgap as SIRA from scr_SecuristLog where Date between @date1 and @date2 and Page=@page or Page = AllDATA ...

Possible to edit a collection in SSIS

I am trying to change a maintenance plan in SSIS to dynamically backup certain databases to certain places based on certain conditions... But it looks like the maintenance tasks use a collection for the selected databases list. As far as I can tell, I can't seem to manipulate a collection through an expression, nor can I seem to load up...

In SQL Reporting Services, how to filter a dataset according to a parameter?

Hello, I've got an unfiltered dataset to deal with so as to generate a report (SQL Server 2005, btw). Let's say I've got a Name column, and I'd want to ad a parameter to my report, so as to select only the names containing some characters. Does one know how to deal with these filters? I tried with no luck this: =Fields!Name.Value ...

Invalid object name error when trying to execute stored procedure?

Not sure what the deal is I have the stored procedure named exactly what I am calling however it always gives me this invalid object error. Here is the connection code, the error is thrown on the second to last line there. SqlConnection cnstr = new SqlConnection(ConfigurationManager.ConnectionStrings["darconn"].ConnectionString); ...

SQL Server: How to get hold of XML attributes in a query?

I'm currently trying to get all of the attributes from some XML with an SQL query. I've been attempting the following to retrieve it, but I must be missing something rather fundamental. DECLARE @T varchar(max) SET @T = '<root> <Field FieldRowId="1000"> <Items> <Item Name="CODE"/> <Item Name="DATE"/> </Items> <Attribute...

How to install fulltext on sql server 2008?

Hi, Trying to install fulltext on my sql server 2008 box. I went to 'programs and features', selected sql server 2008 and now I get this popup asking to choose either: add/ repair or remove. I click on add, and it asks me for the location of sql server CD? I extracted the ISO we have, not sure which file to point it too? ...

Remove dbo. schema prefix from SQLServer (2005) Management Studio's Object Explorer

I'd like to remove the dbo prefix from the Object Explorer so I can press the 'S' key and go to the tables that begin with 'S', having dbo there is irritating (to me). I have searched on the net and there was an answer at that other site that said I should use F7 in the summary tab, but I couldn't find a summary tab, and pressing F7 in ...

SQL selection join help

I'm having problems figuring out a query for this scenario. I have two tables I want to use in this query, they are like this: Units ID Other Data People ID UnitID <-- fk to Units Other Data This is what I want to do: I want to select all the units that do NOT have a row in the People table linked to them. How can I do this...

How can I change this sql statement into something Crystal Reports

I have three tables in my Crystal Reports and it looks like this: Property ID Other Data Unit ID PropertyID <-- fk to Property Other Data Tenant ID UnitID <-- fk to Unit Other Data The report is going to show only Unit's (grouped by the property they belong to) that do not have any tenant's linked to it. Some nice peop...

Should I neccessarily have a PK on the source table to create an ADO.NET Entity Data Model?

I'm trying to "Entitify" some external table (which I don't administer) in order to use it within a MVC application and in principle I'm not being terribly successful with the attempt (VS2008 output): Error List [0 Errors] [0 Warnings] [1 Message] Description The table/view 'DATABASE.dbo.table' does not have a primary key defined and ...

SQL Case with conditions...

Hi, I have a query set up that contains a CASE statement which works 95% of the time... That other 5% is due to the data not being there. There is other data that indicates pointers that will help... I just know if this is possible... So: CASE PRDE.STATUSCODE WHEN 'A' THEN 'Appealed' WHEN 'D' THEN 'Dismissed' WHEN 'P' THEN 'Pending' WH...

SQL Server Query Performance, Large where statements vs. queries

I am wondering which is a more efficent method to retrieve data from the database. ex. One particular part of my application can have well over 100 objects. Right now I have it setup to query the database twice for each object. This part of the application periodically refreshes itself, say every 2 minutes, and this application will pr...

What's the best practice of naming stored procedure for t-sql?

I have worked with several big databases and the names of stored procedures were very different: SP_PrefixXXX PrefixYyyXxx Prefix: Rep, Act What's the best practice of naming? How can I organize them in a proper way? ...

Unexpected table scan for id != id

One application causes a heavy load on our Sql Server 2005 database. We don't control the application that runs this query hundres of times a minute: select id,col1,col2,col3 from table where id != id Note the id != id, meaning a row is not equal to itself. Unsurprisingly, the result is always no rows found. However, Sql Server does a...

Querying real time data from an SQL database sudden latency problem.

We are testing an application that is supposed to display real time data for multiple users on a 1 second basis. New data of 128 rows is inserted each one second by the server application into an SQL datatbase then it has to be queried by all users along with another old referential 128 rows. We tested the query time and it didn't exce...

Simplifying SQL Server's Logins/Owners/Schemas/Roles/Principals etc...

I frequently develop small internet applications using ASP.NET and SQL Server 2005. My databases are always only accessed by one application through an ASP.NET web service or something similar. When I'm developing an application and moving a database back and forth between my development computer (SQLExpress 2008) and hosted server (SQ...

SQL Server lock escalation issue

Hello everyone, I am reading SQL Server lock escalation from MSDN Page about SQL Server lock escalation My question is, seems the major reason why there is lock escalation is to reduce overhead to maintain more locks (e.g. when more row locks are acquired for a table, then row level lock is escalated to table level). My question is, to...

Query SQL Server from Oracle - force metadata refresh

I am a SQL Server developer, with a task in Oracle. DBA set up a DBLink in Oracle that points at a SQL Server database. I am writing a view on the SQL Server data and then a view on the Oracle side to join it with additional Oracle data. Problem: if I change the definition of the view on SQL Server, even "Select * From myview@dblink" er...