sql

Microsoft ASP.NET 2.0 Providers meaning for LoweredApplicationName

Hi, Im using Microsoft ASP.NET 2.0 Provider to setup USERS, ROLES and MEMBERSHIP for my website. I can see new table in my DataBase. I would like to know what is used for: table: aspnet_Applications fields: LoweredApplicationName and table: aspnet_Users fields LoweredUserName MobileAlias Thanks guys for your great support! ...

Splitting variable length delimited string across multiple rows (SQL)

I have a table that contains in one column a variable length delimited string for example: 20,0, 5,,^24,0, 0,,^26,0, 0,,^ 281,0, 0,,^34,0, 2,,^48,0, 2,,^44,0, 2,,^20,0, 10,,^ 20,5, 5,,^379,1, 1,,^26,1, 2,,^32,0, 1,,^71,0, 2,,^ What i need to do is split this string so that each number after the ^ character is returned on a new ...

Using a User Defined Function in a View

I wrote the code for a View which needs to call a user defined function which returns a table to join with it. The problem here is passing the parameter that this functions needs straight out of my view. Below is the code of my view: select GG.Gid, GG.StockType StockType, COALESCE(STC.Contract, 0) ContractId, COALESCE(C...

SQL Union/Join Query

I have a user profile table with columns User Name, manager and many other fields, for example amount.. Example Records:- User Manager Amount A B 100 x y 200 B C 300 M N 800 C D 500 P Q 1000 D E 1000 I am trying to get the result as below:- User...

SQL query to get columns and records of that columns using like operator

Hi, I have a table as show below the bold words are column names KEYWORD PART1_D1 PART1_D2 PART1_D3 PART1_D4 PART2_D5 y 1 0 0 0 1 Chinese 3 2 2 1 1 Tokyo 1 0 0 0 1 Japan 1 0 0 0 1 Beijing 0 ...

Error 42S02 from the Microsoft Drivers for PHP for SQL Server

Hi I am trying to extract some data from a SQL Sever database via PHP using the Microsoft Drivers for PHP for SQL Server. Some tables I can retrieve fine but others give the following error message: Array ( [0] => Array ( [0] => 42S02 [SQLSTATE] => 42S02 [1] => 208 [code] => 208 [2] => [Microsoft][SQL Server Native Client 10.0][SQL...

Problem in Restore backup

I use this script for create and restore PTMS_03_1389: RESTORE DATABASE [PTMS_03_1389] FROM DISK = N'F:\ACCP_Main\PTMSNULL' with MOVE N'PTMS_03_1389' TO N'C:\PTMS_03_1389.mdf' , MOVE N'PTMS_03_1389' TO N'C:\PTMS_03_1389__log.ldf' , REPLACE but i've got this error: Logical file 'PTMS_03_1389' is not part of database 'PTMS_03_1389'....

select rownum from salary where rownum=3;

How to retrieve third row from any table using "rownum" key word ( i am using oracle-10g) ...

PSQL: select all assets that have all of given list of associated objects ids

Suppose we have a standard has and belongs to many association between products and categories product_categories table consists of product_id and category_id pairs. We have list of category_id's and need to select all products that belongs to all these categories. The best approach that came to my mind is to have multiple EXISTS() in ...

SQL LIKE Command trouble searching for '

Hi I am facing a problem with the like command in SQL, I want to search for special characters within a column . The special characters are a single quotation mark ' and { and }.. I have tried placing these special characters under [] but still it doesn't work for ' I have also used the except option but that was also of no help.. Wa...

Retrieve last row inserted with Uniqueidentifier that it is not IDENTITY

Hi, I am puzzled with a query. I need find out the LAST row added in a table with a column with datatype Uniqueidentifier column is: aspnet_Applications.ApplicationId Notes: This column Uniqueidentifier it is NOT and IDENTITY Column. I need also take the last row inserted and update it on a different table aspnet_Users.ApplicationId I...

how to update multiple rows with the same sequnce value

I'm using DB2 and want to update several rows that meet my condition with the same next value from my sequence. Here is what I tried but this doesn't work as the next value is fetched for each row:- update dependency dep set vid=NEXT VALUE FOR seq_VID where id in ('8371','8372','8373') id is the the primary key and seq_VID is a sequen...

OpenText LiveLink - Retrieve content of a LiveReport from database query

How to query DTree (DataID) for the content of a LiveReport (retrieve the live report's sql content)? ...

Can i set up sql server as master and my sql as slave in replication

Can i set up sql server as master and my sql as slave in replication? I can find only two subscriber ie.Oracle Subscribers and IBM DB2 Subscribers. how to add my sql>??? – Edit Sorry for not asking question properly,See we will be getting sql server backup from client every night,and we have to load it to my sql every night.so we my s...

Oracle Invalid number error from C#

I run the below code in my C# .Net application, but I keep getting error ORA-01722: invalid number. When running the same SQL directly in PL/SQL Developer it does exactly what I ask it to without complaining. What could be causing this? OracleCommand command = connection.CreateCommand(); command.CommandType = CommandType.Text; command....

how to read and write MP3 to database

how to read MP3 from Sql database. in sql i have stored the file as binary format. now i want to retrive the Mp3 file stored in the sql and show in my aspx page. how???? pls help... ...

How to see a list of all the indexes (including implicit ones) in SQL*Plus?

Is there some way to get a list of all the indexes on a particular table using SQL*Plus? I created a table CREATE TABLE temp( id NUMBER PRIMARY KEY, name VARCHAR2(20)); There should be an implicit index created on the primary key (id). How can I see that index? SELECT * FROM all_indexes WHERE table_name = 'temp'; gives no rows se...

inserting to a table with an identity column

i am trying to insert a row to a table with an identity column and three "normal" columns using entity framework in wpf. however i got this error message: Cannot insert explicit value for identity column in table 'MyTable' when IDENTITY_INSERT is set to OFF here is my code snippet, trying to add to the user table who has name, surname, a...

Merge 2 SMS databases (sms.db) from 1 iPhone 3GS running on iOS 4.0.1 and putting the output file back on the iPhone without the SMS App crashing

First of all, I've never really done any heavy programming, just fooling around a bit with Python. If any of my questions sound odd or so, please try to understand me. I have a following problem: My iPhone 3GS running on iOS 4.0.1 had problems with making outgoing calls. The only way to solve this problem was to restore iPhone to its f...

What is the use of "&" operator in SQL SERVER.

What is the use of & operator in the code specified below. IS there any benefit of using & instead of "AND". Please elaborate. CASE ( C.[Status] & F.[Status] & D.[Status] & DWT.[Status] & P.[Status] ) WHEN 1 THEN CASE ( C.IsDeleted & F.IsDeleted & D.IsDeleted & P.IsDeleted ) WHEN 0 THEN NULL ELSE 7 EN...