Jump to content

Ms Sql Server Technology Discussions


9Pardhu

Recommended Posts

anukunta s%H#
[quote name='Kaarthikeya' timestamp='1366301217' post='1303626421']
May be nuvvu use chese version nenu use chese version veremo s%H#

All I can see is only 'Modify' on an existing table..and nuvvu cheppina desing lo lage cheyyochu indulo s%H#
[/quote]

Link to comment
Share on other sites

@Kaarthikeya -

nenu annedi below link lo first image lo Edyears ani oka column undhi kada below that if you enter the column name and data type and hit save it will work ...I think thats what he meant when he said by GUI s%H#

http://www.cs.trinity.edu/~thicks/Tutorials/MSSQ-Database-Google-Windows-Form-App-1/MSSQ-Database-Google-Windows-Form-App-1.html

Link to comment
Share on other sites

[quote name='Sdaedalus' timestamp='1366305660' post='1303627051']
@Kaarthikeya -

nenu annedi below link lo first image lo Edyears ani oka column undhi kada below that if you enter the column name and data type and hit save it will work ...I think thats what he meant when he said by GUI s%H#

[url="http://www.cs.trinity.edu/~thicks/Tutorials/MSSQ-Database-Google-Windows-Form-App-1/MSSQ-Database-Google-Windows-Form-App-1.html"]http://www.cs.trinit...Form-App-1.html[/url]
[/quote]ya got it indaake... s%H# but based on the version when right clicked it may be either 'modify' or 'design' anukunta s%H#

PS: do u work for google? sSc_hidingsofa

Link to comment
Share on other sites

first ardam kale tarvatha aa db name chusa CITI_c$y
P.S: koncham alantidhey sSc_hidingsofa
[quote name='Kaarthikeya' timestamp='1366306626' post='1303627186']
ya got it indaake... s%H# but based on the version when right clicked it may be either 'modify' or 'design' anukunta s%H#

PS: do u work for google? sSc_hidingsofa
[/quote]

Link to comment
Share on other sites

[quote name='Sdaedalus' timestamp='1366306927' post='1303627234']
first ardam kale tarvatha aa db name chusa CITI_c$y
P.S: koncham alantidhey sSc_hidingsofa
[/quote]not only that db name...all the applications built below also same sSc_hidingsofa

anduke asked....

PS: plz throw some light on me s%H#

Link to comment
Share on other sites

yes yavaro university prof sample kosam create chesinatu unnaru sSc_hidingsofa
P.S: at least 1 week ki maa company peru thalchukuntar db lo sSc_hidingsofa light off ipoyindi inka anthey @3$%
[quote name='Kaarthikeya' timestamp='1366307062' post='1303627255']
not only that db name...all the applications built below also same sSc_hidingsofa

anduke asked....

PS: plz throw some light on me s%H#
[/quote]

Link to comment
Share on other sites

[quote name='Sdaedalus' timestamp='1366307247' post='1303627282']
yes yavaro university prof sample kosam create chesinatu unnaru sSc_hidingsofa
P.S: at least 1 week ki maa company peru thalchukuntar db lo sSc_hidingsofa light off ipoyindi inka anthey @3$%
[/quote]


avuna? sCo_^Y entabba adi? sCo_^Y

Link to comment
Share on other sites

  • 2 weeks later...

[color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[i][b]Table-Valued Parameters[/b][/i] is a new feature introduced in SQL SERVER 2008. In earlier versions of SQL SERVER it is not possible to pass a table variable in stored procedure as a parameter, but now in SQL SERVER 2008 we can use Table-Valued Parameter to send multiple rows of data to a stored procedure or a function without creating a temporary table or passing so many parameters.[/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
Table-valued parameters are declared using user-defined table types. To use a Table Valued Parameters we need follow steps shown below:[/size][/font][/color][list]
[*]Create a table type and define the table structure
[*]Declare a stored procedure that has a parameter of table type.
[*]Declare a table type variable and reference the table type.
[*]Using the INSERT statement and occupy the variable.
[*]We can now pass the variable to the procedure.
[/list][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
For Example,[/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
Let’s create a Department Table and pass the table variable to insert data using procedure. In our example we will create Department table and afterward we will query it and see that all the content of table value parameter is inserted into it.[/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
Department:[/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[color=blue]CREATE TABLE [/color][color=black]Department[/color]
[color=gray]([/color]
[color=black]DepartmentID [/color][color=blue]INT PRIMARY KEY[/color][color=gray],[/color]
[color=black]DepartmentName [/color][color=blue]VARCHAR[/color][color=gray]([/color][color=black]30[/color][color=gray])
)[/color]
[color=blue]GO[/color][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[b]1. Create a TABLE TYPE and define the table structure:[/b][/size][/font][/color]
[color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[color=blue]CREATE [/color][color=black]TYPE DeptType [/color][color=blue]AS TABLE[/color]
[color=gray]([/color]
[color=black]DeptId [/color][color=blue]INT[/color][color=gray], [/color][color=black]DeptName [/color][color=blue]VARCHAR[/color][color=gray]([/color][color=black]30[/color][color=gray])
);[/color]
[color=blue]GO[/color][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[img]http://www.pinaldave.com/bimg/TVP/1_DeptType.gif[/img]
[b]2. Declare a STORED PROCEDURE that has a parameter of table type:[/b][/size][/font][/color]
[color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[color=blue]CREATE PROCEDURE [/color][color=black]InsertDepartment[/color]
[color=#434343]@InsertDept_TVP [/color][color=black]DeptType [/color][color=blue]READONLY[/color]
[color=blue]AS
INSERT INTO [/color][color=black]Department[/color][color=gray]([/color][color=black]DepartmentID[/color][color=gray],[/color][color=black]DepartmentName[/color][color=gray])[/color]
[color=blue]SELECT [/color][color=gray]* [/color][color=blue]FROM [/color][color=#434343]@InsertDept_TVP[/color][color=gray];[/color][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[color=blue]GO[/color][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[b]Important points to remember :[/b][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
- Table-valued parameters must be passed as READONLY parameters to SQL routines. You cannot perform DML operations like UPDATE, DELETE, or INSERT on a table-valued parameter in the body of a routine.[/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
- You cannot use a table-valued parameter as target of a SELECT INTO or INSERT EXEC statement. A table-valued parameter can be in the FROM clause of SELECT INTO or in the INSERT EXEC string or stored-procedure.[/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[img]http://www.pinaldave.com/bimg/TVP/2_Procedure.gif[/img][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[b]3. Declare a table type variable and reference the table type.[/b][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[color=blue]DECLARE [/color][color=#434343]@DepartmentTVP [/color][color=blue]AS [/color][color=black]DeptType[/color][color=gray];[/color][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[b]4. Using the INSERT statement and occupy the variable.[/b][/size][/font][/color]
[color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[color=blue]INSERT INTO [/color][color=#434343]@DepartmentTVP[/color][color=gray]([/color][color=black]DeptId[/color][color=gray],[/color][color=black]DeptName[/color][color=gray])[/color]
[color=blue]VALUES [/color][color=gray]([/color][color=black]1[/color][color=gray],[/color][color=red]'Accounts'[/color][color=gray]),
([/color][color=black]2[/color][color=gray],[/color][color=red]'Purchase'[/color][color=gray]),
([/color][color=black]3[/color][color=gray],[/color][color=red]'Software'[/color][color=gray]),
([/color][color=black]4[/color][color=gray],[/color][color=red]'Stores'[/color][color=gray]),
([/color][color=black]5[/color][color=gray],[/color][color=red]'Maarketing'[/color][color=gray]);[/color][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[b]5. We can now pass the variable to the procedure and Execute.[/b][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[color=blue]EXEC [/color][color=black]InsertDepartment [/color][color=#434343]@DepartmentTVP[/color][color=gray];[/color]
[color=blue]GO[/color][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]

[img]http://www.pinaldave.com/bimg/TVP/3_Execute.gif[/img][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
Let’s see if the Data are inserted in the Department Table[/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[img]http://www.pinaldave.com/bimg/TVP/4_Select.gif[/img][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
[b]Conclusion:[/b][/size][/font][/color][color=#333333][font=verdana, tahoma, arial, sans-serif][size=3]
Table-Valued Parameters is a new parameter type in SQL SERVER 2008 that provides efficient way of passing the table type variable than using the temporary table or passing so many parameters. It helps in using complex business logic in single routine. They reduce Round Trips to the server making the performance better.[/size][/font][/color]

Link to comment
Share on other sites

Hi Guys , I have 20 ssis packages in a project and if i have to execute all[size=3] of them in a sequence, how do i do that ,,, please help me[/size]

Link to comment
Share on other sites

  • 2 weeks later...

Column 'A.RunDate' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. How to solve this...?

Link to comment
Share on other sites

[quote name='Ramakrishna_Bhai' timestamp='1368993089' post='1303772888']
Column 'A.RunDate' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. How to solve this...?
[/quote]
if you put aggregate in the select list u need to specify what columns you need to group by....

Link to comment
Share on other sites

[quote name='Ramakrishna_Bhai' timestamp='1368993089' post='1303772888']
Column 'A.RunDate' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. How to solve this...?
[/quote]
+_(
[quote name='ghazni' timestamp='1368993595' post='1303772898']
if you put aggregate in the select list u need to specify what columns you need to group by....
[/quote]

Link to comment
Share on other sites

[quote name='Ramakrishna_Bhai' timestamp='1367762438' post='1303708925']
Hi Guys , I have 20 ssis packages in a project and if i have to execute all[size=3] of them in a sequence, how do i do that ,,, please help me[/size]
[/quote]
ekkada execute cheystunnav avi Dev lo naa leka prod lo agent thru naa?

Link to comment
Share on other sites

[quote name='DARLING...' timestamp='1369065620' post='1303775102']
ekkada execute cheystunnav avi Dev lo naa leka prod lo agent thru naa?
[/quote]
prod lo

Link to comment
Share on other sites

×
×
  • Create New...