Search Results

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

Page 130/1481 | < Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >

  • SQL Alias as Table.column

    - by bakerjr
    hi, is it possible to alias an aggregate function in a select clause as AliasTable.AliasColumn? The reason is because I want minimum modifications in my arrays (I'm using PHP). Thanks! P.S. I'm using SQl Server 2008

    Read the article

  • SQL Images in different tables

    - by Adonis L
    I am storing images in a SQL database , right now I have images being stored in separate tables depending on the object the images belong to, is there any reason ( performance etc..) why I should keep it this way and not store all images in the same table?

    Read the article

  • SQL hidden techniques?

    - by AlexRednic
    What are those pro/subtle techniques that SQL provides and not many know about which also cut code and improve performance? eg: I have just learned how to use CASE statements inside aggregate functions and it totally changed my approach on things. Are there others?

    Read the article

  • How to quote and reference MS SQL table and field names

    - by artvolk
    Good day! Despite the fact LINQ2SQL and ADO.NET Entity Framework exists there were situations when I need to revert to plain old DataSet (not typed) and friends. While writing SQL for SqlCommand: Is it needed to quote field and table names with []? Is it good to prefix table names with [dbo] I use to use this syntax: SqlCommand command = new SqlCommand("SELECT [Field1], [Field2] FROM [dbo].[TableName]", connection); May be there is a better way? Thanks in advance!

    Read the article

  • How to convert row data into columns in SQL

    - by iHeartDucks
    Hi, I have looked into pivot but I think it requires an aggregate function which I do not need (I think). The result of my query is this Name Property Name PropertyValue ---------- ---------- ---------- lorem Work Phone 000.111.2020 ipsum Email [email protected] To Name Work Phone Email ---------- ---------- ---------- lorem 000.111.2020 [email protected] ipsum 001.101.2010 [email protected] I don't think I should use pivot here because I don't need to aggregate anything, I just want the row data to become a column.

    Read the article

  • Other language string in SQL Server 2005

    - by balachandar
    I am trying you insert some string which is not in English (other language). when i fetch back they are not correct. They comes like "?????". But at the same time when I enter the string through the SQL Server UI (SSMS) to enter the string, it works OK. What could be the solution please?

    Read the article

  • How to organize infinite while loop in mssql ?

    - by alpav
    I want to use infinite WHILE loop in SQL 2005 and use BREAK keyword to exit from it on certain condition. while true does not work, so I have to use while 1=1. Is there a better way to organize infinite loop ? I know that I can use goto, but while 1=1 begin .. end looks better structurally.

    Read the article

  • SQL to search duplicates

    - by Ram
    I have a table for animals like Lion Tiger Elephant Jaguar List item Cheetah Puma Rhino I want to insert new animals in this table and I am t reading the animal names from a CSV file. Suppose I got following names in the file Lion,Tiger,Jaguar as these animals are already in "Animals" table, What should be a single SQL query that will determine if the animals are already exist in the table.

    Read the article

  • how to save byte[] value to varbinary(64) field on database

    - by shamim
    byte[] a = HashEncript("a"); public byte[] HashEncript(string Password) { SHA512Managed sha = new SHA512Managed(); byte[] hash = sha.ComputeHash(UnicodeEncoding.Unicode.GetBytes(Password)); return hash; } i want to save byte[] a this value on my database .My database field is varbinary(64).i use msSQL2008 .how to save ,want to know the insert query with C# code.

    Read the article

  • SQL IN Statement using like syntax?

    - by StackUnderflow
    I would like to do something like this i.e., use wild card characters in the in clause: SELECT * FROM mytable WHERE keywords IN ('%test%', '%testing%') This is not supported in MS SQL.... Is there some other way to achieve it... Looking for something other than: SELECT * FROM mytable WHERE keywords like '%test%' or keywords like '%testing%' or.....

    Read the article

  • SQl Server - Hierarchical Data

    - by JMSA
    I use SQL Server 2000. Suppose I have two tables like the following: Area ---------------------------------- ID| Name | HierarchyLevel ---------------------------------- 1 | World | 1 2 | America| 2 3 | Europe | 2 4 | Africa | 2 5 | USA | 3 and AreaHierarchy ------------------------ ID | ParentID | ChildID ------------------------ 1 | 1 | 2 2 | 1 | 3 3 | 1 | 4 4 | 2 | 5 where AreaHierarchy.ParentID and AreaHierarchy.ChildID are FKs of Area.ID How can I find the nth parent of USA? Is it possible without looping? Probably not.

    Read the article

  • null from C# getting converted into 'NULL' in Sql Server

    - by Anand
    I am trying to insert NULL value in Sql Server if I have null value in corresponding C# String object like below : String Residence = xmlDoc.Descendants("Appointment").Single().Element("StateOfResidence") == null ? null : xmlDoc.Descendants("Appointment").Elements("StateOfResidence").Single().Value; I am using Entity framework for Database access. So if Residence is null, 'NULL' gets inserted into Database instead of NULL. How can insert NULL for null ?

    Read the article

  • Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing

    - by Paresh
    I am getting the error from the application as following with SQL server 2005 "Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 0" How can i find the stage where this error raised? how can i found the missing transaction or the stored procedure where it is not committ or rollback?

    Read the article

  • SQL inserting value of a specific column under multple case

    - by Lo Wai Lun
    Suppose I have got a table which I have to insert the description of the contract under different keys of contract. But when executing, there is a n error near then Is there any limitation of using syntax set ? The below is my SQL declare @i int, @j v nvarchar(MAX) set @i = 1 while (@i<=8) begin set @j = case when @i = 1 then 'CR' when @i = 2 then 'Facebook' else 'N/A' end INSERT INTO CostNature (CNKey, CNNDescription) VALUES (@i , @j ); set @i = @i + 1 end

    Read the article

  • Rollback SQL Server 2012 Sequence

    - by VAAA
    I have a SQL Server 2012 Sequence object: /****** Create Sequence Object ******/ CREATE SEQUENCE TestSeq START WITH 1 INCREMENT BY 1; I have a SP that runs some queries inside a transaction: BEGIN TRAN SELECT NEXT VALUE FOR dbo.TestSeq <here all the query update code......> ROLLBACK TRAN If the transaction fails all the updates are rolledback without problem but the Sequence is not rolled back I guess because Its out of the scope of the transaction. Any clue on way to handle that? Thanks

    Read the article

< Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >