I have a table in which the userpassword field have varbinary datatype, So im confused that in which form should i save the data into userpassword field because when i save varchar data it gave me error.
...
Say there is a database with 100+ tables and a major feature is added, which requires 20 of existing tables to be modified and 30 more added. The changes were done over a long time (6 months) by multiple developers on the development database. Let's assume the changes do not make any existing production data invalid (e.g. there are defau...
How i can validate sql scripts before executing using .net2 and c#. If sql is not valid i want to return error rows.
...
This is my logic.
I have an articles table and a matching images tables. The images are stored in binary format. Each image table has 2 instances of each image, this is because I have 2 sizes. 300 x 200 and 500 x 400 with their rows separated by ImageSize
I want to write a stored procedure that checks if ImageSize=3 is available and if...
I am desiging a new table that will potentially have 200K rows.
I would like to make sure that querys to this table are efficiant.
in the past I had always given a row a unique id in the assumption that this would result in an index:
CREATE TABLE [dbo].[Equipment](
[EquipID] [nchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
...
Environment: SQL Server 2005
I have a stored proc which receives comma separated value in one parameter. I have written a Table Valued UDF function in SQL to break it and and return me it as a table. I am using that value to filter the data in the where clause of the stored proc. Everything works fine until there is NULL in that comma s...
Does defining a foreign key also defines a index? I have mysql v5.1.46 & I am looking at the MySQL Administrator tool and its shows the foreign key as an index, so I wanted to confirm?
...
Let's say we have three tables in a relational database:
Person {id, name}
Obstacle {id, name}
Person_overcomes_obstacle {person_id, obstacle_id}
I want to write a query that tells me if at least one person has overcome all obstacles. Ideas?
...
I've just been reading up on NATURAL JOIN / USING - SQL92 features which are (sadly?) missing from SQL Server's current repertoire.
Has anyone come from a DBMS that supported these to SQL Server (or another non-supporting DBMS) - were they as useful as they sound, or a can of worms (which also sounds possible!)?
...
I have 2 tables, each with an identity column. What I want to do is populate a new 2-column table with those identities so that it results in a pairing of the identities.
Now, I am perfectly able to populate one column of my new table with the identities from one of the tables, but can't get the identities from the other table into my n...
My application stores dates as OLE Automation doubles with the DateTime.ToOADate() command.
Now, I need to create a SQL view wich shows me the Date stored. How can I quickly convert the double to a date?
Thanks
...
Here is my SQL
'SELECT u.`id`,
u.`email`,
u.`password`,
u.`first_name`,
u.`last_name`,
u.`role_id`,
MAX( ul.`datetime` ) as `last_login`,
SUM( ul.`failed` ) as `failed_logins`
FROM `users` `u`
JOIN ( SELECT `user_...
Hi guys,
I have a problem, I hope somebody out there can help.
I'm not really good at sql programming so I need help from u guys.
Here's my problem, I have customercode that has possible of 2 or 3 addresses.
sample:
cust1 address1
cust1 address2
cust1 address3
cust2 address1
cust2 address2
I want to generate a report in .net to...
Hi,
I need to alter multiple tables in a schema, for all tables prefixed with something, for example:
ALTER TABLE "SCHEMA"."TABLE1"
ADD ( "COLUMN1" CHARACTER(4) NOT NULL DEFAULT 'DATA',
"COLUMN2" VARCHAR(16) NOT NULL DEFAULT 'MORE_DATA',
);
I need this to iterate over multiple tables, like SCHEMA.table1, SCHEMA.ta...
I don't think it is possible to do so what I would but I ask anyway.
I've found that I include the same variables in the top of every Stored Proc I make.
These variables are used for logging and error handling. They don't change between stored procs, there meaning if fixed but primary use is to help readability and have a consistent sty...
I have the line below in a .sql script. Not sure what it does. Does it wait for input from user for dbuserid and password or does it take the values from environment?
What does && denote? In test.sql file I saee the line below before creating tables:
CONNECT &&usr/&&pass@&&dbname
...
Hello Friends,
I have developed a desktop application using C# as frontend and SQL as backend.
But one of my client wants to buy it if the software is able to operate from multiple computers and a common database must be placed on one main computer (server).
Hence I wanted to know,
If the already developed application can be configu...
I have 4 tables namely Products, SalesLog, Breakages, SalesReturn.
Products Table
CREATE TABLE [dbo].[Products](
[ProductId] [int] IDENTITY(1,1) NOT NULL,
[pName] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[pSize] [int] NULL,
[pPrice] [decimal](10, 2) NULL,
[pPackQty] [int] NULL,
[pGroup] [int] NULL,
[pCode] [int] NULL,
...
I have the following three tables :
----PRODUCT----
PRODUCT_ID DESC
1 'Pencil'
2 'Paper'
----PRICE_BY_SUPPLIER----
PRODUCT_ID SUPPLIER_ID PRICE
1 1 10
1 2 9
1 3 9.5
2 1 5
...
hello guys, I am having bad times to generate a rdlc report to show report in predefined format given by my client.
Client given format
As you can notice RED background is my problem area, Item "A" price has been changed thrice. And accordingly their sales, breakages and refund quantity is shown. I have 4 tables Products, SalesLog, Br...