Search Results

Search found 37012 results on 1481 pages for 'sql query'.

Page 147/1481 | < Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >

  • MS SQL 2008, join or no join?

    - by Patrick
    Just a small question regarding joins. I have a table with around 30 fields and i was thinking about making a second table to store 10 of those fields. Then i would just join them in with the main data. The 10 fields that i was planning to store in a second table does not get queried directly, it's just some settings for the data in the first table. Something like: Table 1 Id Data1 Data2 Data3 etc ... Table 2 Id (same id as table one) Settings1 Settings2 Settings3 Is this a bad solution? Should i just use 1 table? How much performance inpact does it have? All entries in table 1 would also then have an entry in table 2. Small update is in order. Most of the Data fields are of the type varchar and 2 of them are of the type text. How is indexing treated? My plan is to index 2 data fields, email (varchar 50) and author (varchar 20). And yes, all records in Table 1 will have a record in Table 2. Most of the settings fields are of the bit type, around 80%. The rest is a mix between int and varchar. The varchars can be null.

    Read the article

  • Restore Database from MSSql 2008 to MSSql 2005

    - by Nirmal
    Hello... I have created a set of tables (around 20) in MSSql 2008 and entered around 1000 records to appropriate tables. But the issue is that I want that same tables with all the entered data into MSSql 2005 (SQLEXPRESS). Obviously it won't work by taking a backup and restore it into MSSql 2005 as it won't support backward compatibility. Any suggestion would be appreciated.... Thanks in advance....

    Read the article

  • Recover Data Entered in MSSql 2008 to MSSql 2005

    - by Nirmal
    Hello... I have created a set of tables (around 20) in MSSql 2008 and entered around 1000 records to appropriate tables. But the issue is that I want that same tables with all the entered data into MSSql 2005 (SQLEXPRESS). Obviously it won't work by taking a backup and restore it into MSSql 2005 as it won't support backward compatibility. Any suggestion would be appreciated.... Thanks in advance....

    Read the article

  • ms sql use like statement result in if statement

    - by Asha
    declare @d varchar set @d = 'No filter' if (@d like 'No filter') BEGIN select 'matched' end else begin select 'not matched' end the result of above is always not matched can anybody tell me why and how can I use the like or '=' result in my stored procedure. thanks

    Read the article

  • disaggregate summarised table in SQL Server 2008

    - by Karl
    Hi I've received data from an external source, which is in a summarised format. I need a way to disaggregate this to fit into a system I am using. To illustrate, suppose the data I received looks like this: receivedTable: Age Gender Count 40 M 3 41 M 2 I want this is a disaggregated format like this: systemTable: ID Age Gender 1 40 M 2 40 M 3 40 M 4 41 M 5 41 M Thanks Karl

    Read the article

  • SQL Server 2008, join or no join?

    - by Patrick
    Just a small question regarding joins. I have a table with around 30 fields and i was thinking about making a second table to store 10 of those fields. Then i would just join them in with the main data. The 10 fields that i was planning to store in a second table does not get queried directly, it's just some settings for the data in the first table. Something like: Table 1 Id Data1 Data2 Data3 etc ... Table 2 Id (same id as table one) Settings1 Settings2 Settings3 Is this a bad solution? Should i just use 1 table? How much performance inpact does it have? All entries in table 1 would also then have an entry in table 2. Small update is in order. Most of the Data fields are of the type varchar and 2 of them are of the type text. How is indexing treated? My plan is to index 2 data fields, email (varchar 50) and author (varchar 20). And yes, all records in Table 1 will have a record in Table 2. Most of the settings fields are of the bit type, around 80%. The rest is a mix between int and varchar. The varchars can be null.

    Read the article

  • How can I do this with LINQ?

    - by Liam
    All I'm after doing is this: SELECT CallTypeID, Count(CallTypeID) as NumberOfCalls FROM [Helpdesk_HR].[dbo].[CallHeader] WHERE CallHeader.DateOpened <= GETDATE()-7 GROUP BY CallTypeID in LINQ. But I can't work out a way of doing it and getting it to work. I would use Linqer, but my company won't pay for it at present. Any help is greatly appreciated as I'm sure the answer is obvious. It's just been one of those days today.

    Read the article

  • FullText Search using multiple tables in SQL

    - by Caesar
    Hi there. I have 3 tables, tblBook(BookID, ISBN, Title, Summary) tblAuthor(AuthorID, FullName) tblBookAuthor(BookAuthorID, BookID, AuthorID) tblBookAuthor allows for a single book to have multiple authors and an author may have written any number of books. I am using full text search to search for ranking base on a word: SET @Word = 'FORMSOF(INFLECTIONAL, "' + @Word + '")' SELECT COALESCE(ISBNResults.[KEY], TitleResults.[KEY], SummaryResults.[KEY]) AS [KEY], ISNULL(ISBNResults.Rank, 0) * 3 + ISNULL(TitleResults.Rank, 0) * 2 + ISNULL(SummaryResults.Rank, 0) AS Rank FROM CONTAINSTABLE(tblBook, ISBN, @Word, LANGUAGE 'English') AS ISBNResults FULL OUTER JOIN CONTAINSTABLE(tblBook, Title, @Word, LANGUAGE 'English') AS TitleResults ON ISBNResults.[KEY] = TitleResults.[KEY] FULL OUTER JOIN CONTAINSTABLE(tblBook, Summary, @Word, LANGUAGE 'English') AS SummaryResults ON ISBNResults.[KEY] = SummaryResults.[KEY] The above code works fine for just searching tblBook table. But now I would like to search also the table tblAuthor based on key word searched. Can you help me with this?

    Read the article

  • Linq to sql, summing timespan?

    - by DaRKoN_
    I have a time field in a mssql 2008 database that I want to do something to the effect of: Timespent = x.sum(x => x.AmountOfTime); Where AmountOfTime is a time MSSQL field. Sum seems to only work on decimals, how can I add these columns?

    Read the article

  • Regex expresion in MS SQL

    - by adopilot
    I do not not know much about Regex, I want to try parsing sting from database according to flowing instructions. I know that I am need to use CLR but for begin I want to learn Regex Data in tables look like create table #tempTBL (opis varchar(40)) go insert into #tempTBL select 'C 136' union select 'C 145' union select 'C146' union select 'AK C 182' union select 'C 277' union select 'C-240' union select 'ISPRAVKA PO C 241' And select sting looks like Select reverse( rtrim( ltrim( replace( (substring (reverse(opis) ,0 ,charindex( 'C',reverse(opis) ) ) ) ,'-',' ') ) ) ) as jci from #tempTBL How should looks like my C# code to I repeat this using regex

    Read the article

  • Parralelization in Microsoft SQL Server 2008 R2

    - by stan31337
    We have a specific accounting and production software, called 1C, which uses single user connection to the MS SQL 2008 R2 database. And there are about 500 users connecting to 1C server to perform their tasks. 1C and SQL 2008 are on separate servers. How to configure MS SQL 2008 R2 to effectively use parallelization in this configuration? We have 24 cores, and only one is loaded at 100% at MS SQL 2008 R2 server. We have already configured MS SQL max parallelizm from this MSDN article: http://msdn.microsoft.com/en-us/library/ms181007(v=sql.105).aspx Thank you!

    Read the article

  • To store images in SQL or not?

    - by Brett
    Generally, I had thought it was always better to store images in the filesystem and link to it via the database entry. However, I am trying to optimize my db design and am having a few questions. My images are all really small thumbmails in black and white (not greyscale, but true B&W) and are 70x70 in size. If we take the images (which is basically a 2D array of 1 and 0), it can be stored as binary data that would be approximately 600 bytes each. So my question is whether querying the 600 bytes stored in a db would be faster than querying a link followed by accessing the filesystem; assuming there are a lot of "image" queries being made. Does anyone have any experience with this area? If it matters, I am using MySQL, and MonetDB (separately, but have the same question for both). Many thanks, Brett

    Read the article

  • SQL Server 2005 user permissions

    - by karl
    I have created a database and some dbo.tables. Now I want to create a user that are can read and write to these tables, but not modify or drop. However I want this user to be able to create own tables and let him do what he want with these. Is this possible? Could someone explain how this can be done?

    Read the article

  • Cannot render images locally with Sql Server 2005 Report Services SOAP service calls

    - by user289146
    I am trying to render images from SSRS 2005 via the SOAP call. When the reports service is installed on the same server as my website, the images generated do not render in the page. However, when I connect to the reporting service URL from the same web code on a separate machine the images render just fine. Is there a dependency that I am missing to allow me to run the web and SSRS on the same box?

    Read the article

  • Storing a set of criteria in another table

    - by bendataclear
    I have a large table with sales data, useful data below: RowID Date Customer Salesperson Product_Type Manufacturer Quantity Value 1 01-06-2004 James Ian Taps Tap Ltd 200 £850 2 02-06-2004 Apple Fran Hats Hats Inc 30 £350 3 04-06-2004 James Lawrence Pencils ABC Ltd 2000 £980 ... Many rows later... ... 185352 03-09-2012 Apple Ian Washers Tap Ltd 600 £80 I need to calculate a large set of targets from table containing values different types, target table is under my control and so far is like: TargetID Year Month Salesperson Target_Type Quantity 1 2012 7 Ian 1 6000 2 2012 8 James 2 2000 3 2012 9 Ian 2 6500 At present I am working out target types using a view of the first table which has a lot of extra columns: SELECT YEAR(Date) , MONTH(Date) , Salesperson , Quantity , CASE WHEN Manufacturer IN ('Tap Ltd','Hats Inc') AND Product_Type = 'Hats' THEN True ELSE False END AS IsType1 , CASE WHEN Manufacturer = 'Hats Inc' AND Product_Type IN ('Hats','Coats') THEN True ELSE False END AS IsType2 ... ... , CASE WHEN Manufacturer IN ('Tap Ltd','Hats Inc') AND Product_Type = 'Hats' THEN True ELSE False END AS IsType24 , CASE WHEN Manufacturer IN ('Tap Ltd','Hats Inc') AND Product_Type = 'Hats' THEN True ELSE False END AS IsType25 FROM SalesTable WHERE [some stuff here] This is horrible to read/debug and I hate it!! I've tried a few different ways of simplifying this but have been unable to get it to work. The closest I have come is to have a third table holding the definition of the types with the values for each field and the type number, this can be joined to the tables to give me the full values but I can't work out a way to cope with multiple values for each field. Finally the question: Is there a standard way this can be done or an easier/neater method other than one column for each type of target? I know this is a complex problem so if anything is unclear please let me know. Edit - What I need to get: At the very end of the process I need to have targets displayed with actual sales: Type Year Month Salesperson TargetQty ActualQty 2 2012 8 James 2000 2809 2 2012 9 Ian 6500 6251 Each row of the sales table could potentially satisfy 8 of the types. Some more points: I have 5 different columns that need to be defined against the targets (or set to NULL to include any value) I have between 30 and 40 different types that need to be defined, several of the columns could contain as many as 10 different values For point 2, if I am using a row for each permutation of values, 2 columns with 10 values each would give me 100 rows for each sales person for each month which is a lot but if this is the only way to define multiple values I will have to do this. Sorry if this makes no sense!

    Read the article

  • SQL Server JDBC Exception

    - by user267581
    When using ANT to build my Java application I keep getting this error. I have tried multiple times to use SQLJDBC.JAR and SQLJDBC4.JAR but continually receive this error message. I am completely stumpped why this error is received even after upgrading to sqljdbc4.jar. [javadoc] java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.

    Read the article

  • Counting number of children in hierarchical SQL data

    - by moontear
    Hello, for a simple data structure such as so: ID parentID Text Price 1 Root 2 1 Flowers 3 1 Electro 4 2 Rose 10 5 2 Violet 5 6 4 Red Rose 12 7 3 Television 100 8 3 Radio 70 9 8 Webradio 90 For reference, the hierarchy tree looks like this: ID Text Price 1 Root |2 Flowers |-4 Rose 10 | |-6 Red Rose 12 |-5 Violet 5 |3 Electro |-7 Television 100 |-8 Radio 70 |-9 Webradio 90 I'd like to count the number of children per level. So I would get a new column "NoOfChildren" like so: ID parentID Text Price NoOfChildren 1 Root 8 2 1 Flowers 3 3 1 Electro 3 4 2 Rose 10 1 5 2 Violet 5 0 6 4 Red Rose 12 0 7 3 Television 100 0 8 3 Radio 70 1 9 8 Webradio 90 0 I read a few things about hierarchical data, but I somehow get stuck on the multiple inner joins on the parentIDs. Maybe someone could help me out here. moon

    Read the article

  • Multi-base conversion - using all combinations for URL shortener

    - by Guffa
    I am making an URL shortener, and I am struggling with the optimal way of encoding a number (id) into a character string. I am using the characters 0-9,A-Z,a-z so it will basically be a base-62 encoding. That is pretty basic, but it doesn't make use of all possible codes. The codes that it would produce would be: 0, 1, ... y, z, 10, 11, ... zy, zz, 100, 101, ... Notice that the codes 00 to 0z is not used, the same for 000 to 0zz, and so on. I would like to use all the codes, like this: 0, 1, ... y, z, 00, 01, ... zy, zz, 000, 001, ... It would be some combination of base-62 and base-63, with different bases depending on the position... Using base-62 is easy, for example: create procedure tiny_GetCode @UrlId int as set nocount on declare @Code varchar(10) set @Code = '' while (@UrlId > 0 or len(@Code) = 0) begin set @Code = substring('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', @UrlId % 62 + 1, 1) + @Code set @UrlId = @UrlId / 62 end select @Code But I haven't yet managed to make a multi-base conversion out of it, to make use of all the codes.

    Read the article

  • How can I fill SQL Server table from excel only using sql query?

    - by Phsika
    How can I do that with Microsoft.ACE.OLEDB.12.0? CREATE TABLE [dbo].[Addresses_Temp] ( [FirstName] VARCHAR(20), [LastName] VARCHAR(20), [Address] VARCHAR(50), [City] VARCHAR(30), [State] VARCHAR(2), [ZIP] VARCHAR(10) ) GO INSERT INTO [dbo].[Address_Temp] ( [FirstName], [LastName], [Address], [City], [State], [ZIP] ) SELECT [FirstName], [LastName], [Address], [City], [State], [ZIP] FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=C:\Source\Addresses.xlsx;IMEX=1', 'SELECT * FROM [Sayfa1$]') How can I do that?

    Read the article

  • Just installed Sql Server 2008 and cannot access it

    - by Mendy
    I just install Sql Server 2008 on a new server and I cannot connect to it. I'm trying to connect using Windows Authentication to the localhost but I get the following error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

    Read the article

< Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >