Display view content in SQL Server2008
How can I display the content of all Views in a db in SQL Server 2008? Is there any new system views to do the same? ...
How can I display the content of all Views in a db in SQL Server 2008? Is there any new system views to do the same? ...
i want to know, how to write subquery in between SELECT and FROM as SELECT Col_Name,(Subquery) From Table_Name Where Some_condition ...
I'm working in the development of an ERP type .Net WinForms application consuming a WCF service. It's to be used by many small companies (in the range of 100-200). Database is SQL Server 2008 and the service will be hosted as a Windows service. Even thought there will be a single DB Server, our customer insists in having separate datab...
I have a hierarchy table in SQL Server 2005 which contains employees -> managers -> department -> location -> state. Sample table for hierarchy table: ID Name ParentID Type 1 PA NULL 0 (group) 2 Pittsburgh 1 1 (subgroup) 3 Accounts 2 1 4 Alex 3 ...
Hi guys: I need to add a new SELECT statement whose search condition include something like leagueCode LIKE 'nba%'. I would like to know if the index against leagueCode is still exploitable or introduce any overhead after % is included in the target column. ...
Hi I need some sample SQL Server Employee database with data such as id, surname, name, age, adress etc. It must be quite big, I search with google, but I don't find any good sample. Can any body help ? ...
Hi guys: Suppose we got a original query as follows: SELECT A, B, C FROM tblA Now, I need to additional artificial rows like SELECT 'Kyala', B, C FROM tblA when, for example, C = 100 to be inserted into the resultset. As an example, if the tblA hold one row: A B C John 1 100 my goal is to return two rows like b...
Hi folks: I see a node named "Bookmark Lookup" in my execution plan. What does it means? It costs most among steps inside the plan. Any suggestion to optimize it? ...
Hi. I found this answer and it sounds like almost exactly what I'm doing. I have heard mixed answers about whether or not datamapper can support SQL Server through dataobjects. Basically, we have an app that uses a consistently structured database, consistently named tables, etc in SQL Server. We're making all kinds of tools and stuff th...
My example is similar to this - The only problem is I cannot rewrite this query to cope with columns that have spaces inside it In the example below suppose that rather then [Oranges] you had ['Oranges And Apples'] in one cell. For some reason adding an "'" means the pivot function returns NULL everywhere and [Oranges And Apples] is of...
Hi! I'm wondering if is there a way to force MSSQL Management Studio to produce a script like this: ALTER TABLE Mytable ADD MyCol bit NOT NULL CONSTRAINT MyColDefault DEFAULT 0 WITH VALUES ALTER TABLE [dbo].Mytable ALTER COLUMN MyCol2 int NULL GO when I alter a very simple property of a column on a table. If I do this in the desig...
I have two database say DB_A and DB_B. In DB_A database, table having huge data (few tables are having 2 to 10 million data). I want to move the all table data from DB_A to DB_B database. Please help me on writing stored procedures to move efficiently (fast) the data from one database to another. ...
Hi folks: I heard that setting index is closely related to the sequence of joining tables. Could you provide some examples or article about this point? Thanks. ...
Suppose a query "select streetAdr from Address" returns "236 a1 road" "333 a2 road" and 444 a4 road" as 3 rows. How i can display only "236" "333" and "444" in SQL Server. ...
Hi. I've got a "slightly" large sql script saved as a textfile. It totals in at 8.92gb, so it's a bit of a beast. I've got to do some search and replaces in this file(specifically, change all NOT NULL to NULL, so all fields are nullable) and then execute the darned thing. Does anyone have any suggestions for a text editor that would be ...
How can I query the database culture (SQL Server 2005) ? I have problems inserting and getting dates, because the client's servers don't run on the same culture as my developer server. I can adjust the date, but I need to know the server's culture... ...
Hi iam trying to make an update trigger in my database. But i get this error every time the triggers trigs. Error MEssage: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(3rows) and heres my trigger ALTER TRIGGER [dbo].[x1pk_qp_update] ON [dbo].[x1pk] FOR UPDATE AS BEGIN TRY DE...
In the database I have a field with a .mht file. I want to use FTS to search in this document. I got this working, but I'm not satisfied with the result. For example (sorry it's in dutch, but I think you get my point) I will use 2 words: zieken and ziekenhuis. As you can see, the phrase 'zieken' is in the word 'ziekenhuis'. When I searc...
Question: I can get the SQL Server database language by querying: SELECT @@language And I can get further info via EXEC sp_helplanguage How can I query for a column of sp_helplanguage where name= @@language I do SELECT * FROM sp_helplanguage WHERE name='DEUTSCH' but that obviously doesn't work. What's the correct way to query i...
Question: The new SQL Server 2008 database returns me values formatted English (date/float). Is there a way I can set the return format ? For example temporarely switching the database language? Or just set the language for the current query ? ...