Viewing 15 posts - 121 through 135 (of 394 total)
gurbanov.1984 (7/6/2013)
but this procedure inserted only phone
create procedure inserttable1
@phone int,
@n nvarchar(30),@f nvarchar(30),@c nvarchar (30),@t nvarchar(30)
as
insert table1 select @phone,(select kod from table2 where name_='@n'),(select kod from table3...
July 6, 2013 at 5:26 am
You need to join the lookup tables to the inputs to convert to the key values:
--== SAMPLE DATA ==--
if object_id('table1') is not null
drop table table1;
if object_id('table2') is not null
drop table...
July 6, 2013 at 5:12 am
If you've got SQL Agent jobs running at a certain time, it is to be expected that there will be a spike in memory usage then, so nothing's necessarily wrong.
If...
July 5, 2013 at 9:39 am
Have you got SQL Agent jobs running on the server at those times?
July 5, 2013 at 8:45 am
A lot of people set up a Calendar table specifically for this kind of thing -
see http://www.sqlservercentral.com/scripts/Date/68389/ for example.
Using this as a base, I came up with this:
DECLARE @StartDate Date,
@EndDate...
May 29, 2013 at 3:52 am
When you say its not working do you mean it gives the wrong resukts? If so, what results do you get?
I don't think this is right:
OR (Email = CASE...
May 27, 2013 at 1:03 pm
The simple answer is - You need to use derived SQL to do this:
SELECT MAX( + @ColVal + ) FROM + @TableName
DECLARE @sql Varchar(1000); -- (Declare this outside...
May 24, 2013 at 11:11 am
How about this:
--== Test Data ==--
if object_id('tempdb..#Test') is not null
drop table #Test;
Create Table #Test
(
Valuedt Datetime,
TotalDue_Amount Numeric (12,2),
TotalRecieved_Amount Numeric (12,2),
Maintaince_Due Numeric (12,2),
InsDue Numeric (12,2),
Stationary_Due Numeric (12,2),
Travelling_Exp_Due Numeric (12,2),
Maintaince_Collection Numeric (12,2),
Ins_Collection Numeric...
May 24, 2013 at 2:27 am
Terence Keys (5/20/2013)
you can make it a uniqueidentifier field (GUID)
http://www.dailycoding.com/Posts/generate_new_guid_uniqueidentifier_in_sql_server.aspx
OK if it's just an identifier. I suspect SSN is Social Security Number though...
May 20, 2013 at 11:44 am
There's a UNIQUE keyword in the DDL (table definition) that specifies a unique constraint.
May 20, 2013 at 11:00 am
Something like this should do it:
--i have table with following structure.
--SELECT SaleID, vender_inv, Code, cDate
--FROM SaleMain
--i want to fetch last two invoice against each code.
--where saleid is auto incremented and...
February 24, 2013 at 10:27 am
That should be OK, but you can check using the execution plan. It might be clearer if you put the filters in the order they appear in the index...
February 24, 2013 at 10:19 am
Assuming you're using the single index I suggested, you could accept a search of CityId=@CityId from the user, but to force the query to use theindex you would always add...
February 23, 2013 at 10:50 am
There is no enum data type in SQL 2008. You would usually use a lookup table for something like that - maybe tinyint for the key & varchar for...
February 23, 2013 at 10:01 am
You can select data into temp tables like this:
select *
into #TempTable
from dbo.table
Temp tables starting with one # exist for the session, or until you drop them. If you create...
February 22, 2013 at 2:18 pm
Viewing 15 posts - 121 through 135 (of 394 total)